Subir Das
Subir Das

Reputation: 57

Docusign live account authentication using REST API not working

I am new on Docusign. I have developed a application using REST API on PHP language. In demo account everything is working fine. But in live account does not working. Error is calling webservice and status is 0. I tried many way but can't solve. Please help me. My code for authentication is given below.

$integratorKey = 'xxxxxx';
    $email = 'xxxx';
    $password = 'xxxx';

    // construct the authentication header:
    $header = "<DocuSignCredentials><Username>" . $email . "</Username><Password>" . $password . "</Password><IntegratorKey>" . $integratorKey . "</IntegratorKey></DocuSignCredentials>";


    $url = "https://www.docusign.net/restapi/v2/login_information";
    $curl = curl_init($url);
    curl_setopt($curl, CURLOPT_HEADER, false);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($curl, CURLOPT_HTTPHEADER, array("X-DocuSign-Authentication: $header"));

    $json_response = curl_exec($curl);
    $status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
    //echo $status;
    if ( $status != 200 ) {
        echo "error calling webservice, status is:" . $status;
        exit(-1);
    }

    $response = json_decode($json_response, true);
    $accountId = $response["loginAccounts"][0]["accountId"];
    $baseUrl = $response["loginAccounts"][0]["baseUrl"];
    curl_close($curl);

Upvotes: 1

Views: 965

Answers (1)

Kim Brandl
Kim Brandl

Reputation: 13490

Have you completed the DocuSign API Certification process yet? Your integration will not work against a Production DocuSign account until you've completed the API Certification process and DocuSign has approved your Integrator Key for use in the Production environment. (The main purpose of the certification process is for DocuSign to ensure that your integration isn't doing anything that would be harmful to the Production environment, and to ensure that you're able to produce API request/response information from your app, in case you ever need help from DocuSign support in the future -- once you "pass/complete" certification, DocuSign will enable your Integrator Key for use in Production.)

The DocuSign Developer Center (https://www.docusign.com/developer-center) contains information about the API Certification process. In particular, check out the links in "Go Live" section:

DS Dev Center Go Live

The Go Live - Overview page is a good starting point: https://www.docusign.com/developer-center/go-live/overview

Upvotes: 3

Related Questions