Overview
Syllabus
Welcome and introduction
Off to the SAP Business API Hub to look at the task in hand
Examining the Service Manager API
Looking at the SAP Help Portal docu on how to get an access token and authenticate the calls
Considering the two OAuth 2.0 flows in use
Realising I'm an idiot and had completely missed the content-type header in my quiz question
Examining the docu's curl sample to retrieve a token
Exploring curl's help features
Considering HTTP POST and curl's many facilities for that
A short digression into getting curl to follow redirects with --location, and an examination of --verbose output
Looking at a more comfortable way to express x-www-form-urlencoded name/value pairs with multiple --data parameters
Digging into why the authenticated request for an access token failed: lack of URL encoding of the values
Examining the --data-urlencode parameter option, as opposed to --data
Comparing --include show the response headers with --verbose
Celebrating the receipt of an access token
Trying out a deliberately over-simplified curl request without authentication
Adding, with the --header parameter, a specific Authorization header
Comparing that with the use of --user which generates an Authorization header with some Base64 encoded string for a Basic authentication header automatically
A successfully authenticated call to the /v1/service_offerings endpoint
Avoiding curl's progress indicators with --silent
Getting ready to create a service instance with a POST request and a file-based payload with the @ mechanism of curl's --data parameter
'Useless use of cat' award from shellcheck, hurray!
Examining why we received an error "unsupported media type"
An unexpected but always welcome WhatsApp call from my son Joseph
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
Getting a lovely HTTP 201 CREATED response altho the Location header is missing and checking the result with ijq and also the btp CLI
Finally, using curl to delete the instance with the --request DELETE parameter
Taught by
SAP Developers