I believe it's just an example on their page that just so happens to represent the data in JSON format, probably because it's familiar to most web developers. You could do some fancy json decoding to programmatically insert the values into your request if you're receiving that JSON through another API, but that's probably more than most people need to do.
You are sending a payload via GET for all parameters after the question mark in the URL
?api_password=true&include_account_id_guid=true&login_settings=all
You're providing the authentication credentials as a header.
<?php
$uri = 'https://demo.docusign.net/restapi/v2/login_information?api_password=true&include_account_id_guid=true&login_settings=all';
$headers = 'X-DocuSign-Authentication: {"Username":"","Password":"","IntegratorKey":""}';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$uri);
curl_setopt($ch, CURLOPT_HTTPHEADER, array($headers));
curl_exec ($ch);
curl_close ($ch);
This gives me an expected response because I have no username account:
{ "errorCode": "PARTNER_AUTHENTICATION_FAILED", "message": "The specified Integrator Key was not found or is disabled. An Integrator key was not specified." }
Bonus
In their "Get Token" method via POST, the "body" refers to the POST payload. So first you would indicate to curl that it's a POST request with the CURLOPT_POST
, and then set the value of "body" to the CURLOPT_POSTFIELDS
<?php
$uri = 'https://demo.docusign.net/restapi/v2/oauth2/token';
$headers = array(
'Accept: application/json',
'Content-Type: application/x-www-form-urlencoded',
'Content-Length: 60'
);
$body = 'username=&password=&client_id=&grant_type=password&scope=api';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$uri);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
curl_exec ($ch);
curl_close ($ch);