Service Callout setup

I am making rest service call to a billing application.

From Postman, this is what i do

1. https://myurl/j_security_check?user=xyz&password=abc

2. https://myurl/restSecuritytoken This returns a Oauth2.0 token in the response header, which I copy to the header of the next call

3. https://myurl/svc/getInvoice

How can I set this up in apigee so that the calling application makes just 1 call.

0 2 201
2 REPLIES 2

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.

Not applicable

1. create a reverse proxy with backend https://myurl/svc/getInvoice

2. add a service callout with target https://myurl/j_security_check?user=xyz&password=abc

3. make another service callout with target https://myurl/restSecuritytoken

4. 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.