Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
630 views
in Technique[技术] by (71.8m points)

netsuite Token based Authentication

I am trying to authenticate netsuite through token based I have tried it here but its giving error

{"error" : {"code" : "INVALID_LOGIN_ATTEMPT", "message" : "Invalid login attempt."}}

I referred to code given in the stack solution

I am passing data string as '' right now because I only want to authenticate. What may be am missing in the code and can this code can be run without Script id and deploy id?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

No, you cannot run the code without a script and deployment. And the data string should be an object, even if it's just sample data like '{"test":true}'.

Also, the PHP you have referred to is technically incomplete. To properly send data to NetSuite's RESTLets you need to implement an automatic retry due to the concurrency limits. That said, it doesn't help you with the problem of just connecting.

You should also be calling the NetSuite datacenter to get the proper URL.

 * NetSuite SuiteAnser for datacenter calls
 * https://netsuite.custhelp.com/app/answers/detail/a_id/65684
 * 
 * Sample production response:
 * {"webservicesDomain":"https://webservices.na1.netsuite.com","restDomain":"https://rest.na1.netsuite.com","systemDomain":"https://system.na1.netsuite.com"}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...