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.
You could use 2 ServiceCallouts , to obtain the token. Then cache it.
Then specify the /getInvoice as the “target” URL.
This example does something similar.
-
create a reverse proxy with backend https://myurl/svc/getInvoice
-
add a service callout with target https://myurl/j_security_check?user=xyz&password=abc
-
make another service callout with target https://myurl/restSecuritytoken
-
copy the header from the response of step 3 and set for the final request(i.e. step 1)
Now you can make only one request with all required parameters.