how do I formulate an httpRequest to retrieve an oauth token

Not applicable

the example in your documentation is incomplete/missing functions... serializeQuery, translatorApi.?

function getAccessToken(){var bodyObj ={'grant_type': translatorApi.grantType,'scope': translatorApi.scopeUrl,'client_id': translatorApi.clientId,'client_secret': translatorApi.clientSecret
  };var req =newRequest(translatorApi.authUrl,'POST',{}, serializeQuery(bodyObj));var exchange = httpClient.send(req);// Wait for the asynchronous POST request to finish
  exchange.waitForComplete();

@george.celvi@vantiv.com

Solved Solved
0 1 336
1 ACCEPTED SOLUTION

Hi George,

I checked and this code example is a snippet taken from a complete working example, that you can find here:

https://github.com/apigee/api-platform-samples/tree/master/sample-proxies/outbound-oauth

Unfortunately, the doc doesn't mention this, so I'll add a note to help clarify. I think you'll find the answers to your specific questions by examining the code in that sample project. The JavaScript is in this resource directory: ../outbound-oauth/apiproxy/resources/jsc

Will

View solution in original post

1 REPLY 1

Hi George,

I checked and this code example is a snippet taken from a complete working example, that you can find here:

https://github.com/apigee/api-platform-samples/tree/master/sample-proxies/outbound-oauth

Unfortunately, the doc doesn't mention this, so I'll add a note to help clarify. I think you'll find the answers to your specific questions by examining the code in that sample project. The JavaScript is in this resource directory: ../outbound-oauth/apiproxy/resources/jsc

Will