cancel
Showing results for 
Search instead for 
Did you mean: 
SAP Community Log-in Update
In a few months, SAP Community will switch to SAP Universal ID as the only option to login. Don’t wait, create your SAP Universal ID now! If you have multiple S- or P- accounts, use the Consolidation Tool to merge your content. Get started with SAP Universal ID now!

Back to basics: Using curl in the SAP enterprise landscape

SAP Community

Topics:
HTTP, curl, command line, SAP Service Manager, SAP Business Technology Platform, OAuth 2.0, btp CLI, pass, jq, ijq

Links:
curl homepage: https://curl.se/ 
2 Minutes of API Basics playlist: https://www.youtube.com/playlist?list=PL6RpkC85SLQBCAZNbi-vNMSoXZJZp5wDq 
Working with SAP Service Manager APIs: https://help.sap.com/docs/PRODUCT_ID/09cc82baadc542a688176dce601398de/4e19b11211fe4ca2a266d3fdd4a721...

Chapters:
00:00 Welcome and introduction
07:00 Off to the SAP Business API Hub to look at the task in hand
08:30 Examining the Service Manager API
10:22 Looking at the SAP Help Portal docu on how to get an access token and authenticate the calls
10:40 Considering the two OAuth 2.0 flows in use
11:15 Realising I'm an idiot and had completely missed the content-type header in my quiz question
13:36 Examining the docu's curl sample to retrieve a token
16:02 Exploring curl's help features
18:10 Considering HTTP POST and curl's many facilities for that
19:00 A short digression into getting curl to follow redirects with --location, and an examination of --verbose output
26:20 Looking at a more comfortable way to express x-www-form-urlencoded name/value pairs with multiple --data parameters
30:15 Digging into why the authenticated request for an access token failed: lack of URL encoding of the values
32:30 Examining the --data-urlencode parameter option, as opposed to --data
35:17 Comparing --include (show the response headers) with --verbose
36:19 Celebrating the receipt of an access token
38:40 Trying out a deliberately over-simplified curl request (without authentication)
41:10 Adding, with the --header parameter, a specific Authorization header
41:33 Comparing that with the use of --user which generates an Authorization header with some Base64 encoded string for a Basic authentication header automatically
44:15 A successfully authenticated call to the /v1/service_offerings endpoint
45:28 Avoiding curl's progress indicators with --silent
46:55 Getting ready to create a service instance with a POST request and a file-based payload with the @ mechanism of curl's --data parameter
50:22 'Useless use of cat' award from shellcheck, hurray!
52:00 Examining why we received an error "unsupported media type"
52:48 An unexpected but always welcome WhatsApp call from my son Joseph
53:40 Fixing the call with another --header parameter to specify that the Content-Type is of the payload I'm sending is application/json (curl sends application/x-www-form-urlencoded by default)
54:02 Getting a lovely HTTP 201 CREATED response (altho the Location header is missing) and checking the result with ijq and also the btp CLI
57:00 Finally, using curl to delete the instance (with the --request DELETE parameter)



Featured Guests
Featured Guests
Employee
Employee


Event has ended
You can no longer attend this event.

Starts:
Ends:
0 Comments