I am making rest service call to a billing application.
From Postman, this is what i do
-
https://myurl/j_security_check?user=xyz&password=abc
-
https://myurl/restSecuritytoken This returns a Oauth2.0 token in the response header, which I copy to the header of the next call
-
https://myurl/svc/getInvoice
How can I set this up in apigee so that the calling application makes just 1 call.
1 Like
you have specified three calls and you want to make only one call. Let me explain as below.
-
create a proxy in apigee which will have the target as https://myurl/svc/getInvoice
-
assign a service callout in the proxy endpoint preflow, and call to https://myurl/j_security_check?user=xyz&password=abc by setting proper user and password information from the request.
-
if step two provides successful response then in another service callout make a call to https://myurl/restSecuritytoken
-
if step 3 provides a successful response then set the request header with the OAuth token header value received, using assign message policy.
-
now the actual request will go to the backend https://myurl/svc/getInvoice.