Skip to content

Commit

Permalink
update Books via mtxs-review app
Browse files Browse the repository at this point in the history
  • Loading branch information
gregorwolf committed Apr 4, 2024
1 parent 0fc7d64 commit 3c31382
Showing 1 changed file with 45 additions and 3 deletions.
48 changes: 45 additions & 3 deletions test/entra-id-sap-ias-token-exchange.http
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,57 @@ GET {{$dotenv graph_uri}}/api/{{$dotenv graph_name}}/my.a4h.user/UserDetailsSet
Authorization: Bearer {{access_token_btp}}
### Call OData Service of Multitenant Application
### https://github.com/gregorwolf/mtxs-bookshop
GET {{$dotenv btp_mtx_srv}}/odata/v4/catalog/Books
?$filter=IsActiveEntity eq false or IsActiveEntity eq true
### Read Active
GET {{$dotenv btp_mtxs_bookshop_srv}}/odata/v4/catalog/Books
Authorization: Bearer {{access_token_btp}}
### Read Drafts
GET {{$dotenv btp_mtxs_bookshop_srv}}/odata/v4/catalog/Books
?$filter=IsActiveEntity eq false
Authorization: Bearer {{access_token_btp}}
###
POST {{$dotenv btp_mtx_srv}}/odata/v4/catalog/Books
POST {{$dotenv btp_mtxs_bookshop_srv}}/odata/v4/catalog/Books
Authorization: Bearer {{access_token_btp}}
Content-Type: application/json

{
"title": "Per Anhalter durch die Galaxis",
"stock": 500
}
### Call OData Service of Multitenant Application
### https://github.com/gregorwolf/mtxs-reviews
GET {{$dotenv btp_mtxs_reviews_srv}}/odata/v4/review
Authorization: Bearer {{access_token_btp}}
###
# @name getBooks
GET {{$dotenv btp_mtxs_reviews_srv}}/odata/v4/review/Books
Authorization: Bearer {{access_token_btp}}
###
@bookId={{getBooks.response.body.$.value[0].ID}}
###
PATCH {{$dotenv btp_mtxs_reviews_srv}}/odata/v4/review/Books({{bookId}})
Authorization: Bearer {{access_token_btp}}
Content-Type: application/json

{
"stock": 500
}

### Get Access Token for Destination Service
# @name requestDestinationAccessToken
POST {{$dotenv dest_tokenendpoint}}/oauth/token
Authorization: Basic {{$dotenv dest_clientid}}:{{$dotenv dest_clientsecret}}
Content-Type: application/x-www-form-urlencoded

grant_type=client_credentials
&response_type=token

### Fill Variables from Response
@destination_access_token = {{requestDestinationAccessToken.response.body.$.access_token}}

### Get Access token from Destination Service using the OAuth2SAMLBearerAssertion Destination
# According to https://api.sap.com/api/SAP_CP_CF_Connectivity_Destination/path/get_destinations__name_
### Read details of one destination
# @name requestProviderDestination
GET {{$dotenv dest_uri}}/destination-configuration/v1/destinations/mtxs-bookshop
X-user-token: {{access_token_btp}}
Authorization: Bearer {{destination_access_token}}

0 comments on commit 3c31382

Please sign in to comment.