Prabhu
Prabhu

Reputation: 927

How to get Consumer Key and Consumer secret from Netsuite?

<?php
$url = 'https://system.netsuite.com/rest/roles';
$url = 'https://system.na1.netsuite.com/rest/issuetoken?consumerKey=XXXXXXXXXXXXXXXXXXXX';
$access_token ='nlauth_account=XXXXXXXXXXXXX,nlauth_email=XXXXXXXXXXXXXX, nlauth_signature=XXXXXXXXXX';
$header = array('Content-Type: application/json','Authorization : NLAuth '.$access_token);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_HTTPHEADER,$header) ;
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$result = curl_exec($ch);
curl_close($ch);
$result = json_decode($result, true);
echo '<pre>';print_r($result);exit;
?>

I got Oauth access token id and token secret by the above code using consumer key, account id, email and pwd. By passing any ohter different args like the above code or restlet, i want to get consumer key and consumer secret.

Thanks in advance

Upvotes: 1

Views: 3307

Answers (1)

Shea Brennan
Shea Brennan

Reputation: 1132

The consumer key and consumer secret and not retrievable programatically.

There's a warning when you create the a token-based application in Netsuite:

Warning For security reasons, the only time the Consumer Key and Consumer Secret values are displayed is on the confirmation page. After you leave this page, these values cannot be retrieved from the system. If you lose or forget these credentials, you will need to reset them to obtain new values. Treat these values as you would a password. Never share these credentials with unauthorized individuals and never send them by email.

Upvotes: 2

Related Questions