如何从 Netsuite 获取 Consumer Key 和 Consumer secret?
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;
?>
我通过上面的代码使用消费者密钥、帐户 ID、电子邮件和密码获得了 Oauth 访问令牌 ID 和令牌机密。通过传递任何其他不同的参数,如上面的代码或 restlet,我想获得消费者密钥和消费者秘密。
提前致谢
消费者密钥和消费者秘密,无法通过编程方式检索。
在 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.
<?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;
?>
我通过上面的代码使用消费者密钥、帐户 ID、电子邮件和密码获得了 Oauth 访问令牌 ID 和令牌机密。通过传递任何其他不同的参数,如上面的代码或 restlet,我想获得消费者密钥和消费者秘密。
提前致谢
消费者密钥和消费者秘密,无法通过编程方式检索。
在 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.