Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- getToken();
- function getToken()
- {
- var options = {
- url: 'https://demo.docusign.net/restapi/v2/oauth2/token',
- method: 'POST',
- headers: {
- "Accept": "application/json",
- "Content-Type": "application/x-www-form-urlencoded",
- "Content-Length": 152,
- "grant_type=password&client_id=integrationid&username=email&password=password&scope=api"
- }
- };
- // Send a http request to url and specify a callback that will be called upon its return.
- request(options, function (error, response, body)
- {
- var obj = JSON.parse(body);
- console.log( obj );
- for( var i = 0; i < obj.length; i++ )
- {
- var name = obj[i].name;
- console.log( name );
- }
- });
- POST https://{server}/restapi/{apiVersion}/oauth2/token
- Accept: application/json
- Content-Type: application/x-www-form-urlencoded
- grant_type=password&client_id={IntegratorKey}&username={email}&password={password}&scope=api
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement