Hi all, We would like to integrate a CPM Software ...
# integrations
m
Hi all, We would like to integrate a CPM Software ( https://www.onestreamsoftware.com/) with NetSuite. I’ve no experience with integration in NetSuite, and 3rd party developer less than me. For what I understood, reading Help Center, the options available: RESTlets, SOAP-based web services, REST web services and Suite Analytics Connect (ODBC, but at the moment is not active on my account). I have some doubts about the authentication method. I read that the authentication flow with TBA and OAuth 2.0, requires the ability to open a browser, but this is incompatible with a system to system integration. Could be the IssueToken Endpoint a solution? I’m bit confused because of the following phrase “If you decide to use TBA for new integrations, you should use the TBA Authorization Flow. Developers of existing integrations currently using the issuetoken endpoint should consider migrating the integration to the authorization flow.” Thank you very much for your help
m
Use OAuth 1.0.
b
There are 4 options to getting the tokens used in TBA (OAuth 1) 1. The Three-Step TBA Authorization Flow - For when an integrator wants to receive tokens to their external server after having a user grant access via a browser 2. The IssueToken Endpoint - For when an integrator wants to receive tokens to their external server by using the user's credentials 3. Assign a TBA Token - For when a high permission user want to create tokens for another user to give to the integrator 4. Create a TBA Token - For when a lower permission user want to create a token for themselves to give to the integrator Either way, you only need to get the token once. You store the tokens somewhere secure on your server and use them from there. Options 1 and 2 are for more serious integrations meant to be used by multiple accounts
m
So after assigning a TBA Token I mean the 3rd option, how do I use the generated keys to authenticate rest api? Is there an example of a curl request where we specify the authentication headers?
b
i personally would abandon using curl unless you know how to implement oauth 1 using it
netsuite has postman instructions at Working with REST Web Services Using Postman
m
Thanks will check it
b
be weary of using the beta records from REST web services
m
Oh why? Do you suggest using SOAP for a new integration?
b
beta means that the record metadata is not stable
can/will change
m
I am new to Netsuite so sorry in advance if this doesn't make sense but what do you mean by record metadata? We want to have a small integration where we sync few resources such as inventory_item and purchase_orders, so I assume the structure of the rest api would not change too much or it would be easy to fix it even it changes. Do you still think even for such a small case using beta api is not a good idea? I have benn told that netsuite is investing on the REST API for future.
b
the json data that you post can and has changed
if you know how to do a soap integration, or if you require a stable api, choose SOAP
m
I find this on the SuiteAnswer as sample of code showing how to do a HTTP POST Request using Token-based Authentication. https://netsuite.custhelp.com/app/answers/detail/a_id/44021/
m
Thanks @battk for the tip and @Matteo Colombo for the shared article 👍
Apparently beta is not allowed to be used for new users at this point anyway.
m
@Mehmet Cubuk but this message appear when?
m
If you go to setup / company / enable features page, this warning is shown for us. I was working with postman example and I was able to authenticate the request but started getting the following error:
Copy code
The customer record is only available as a beta record. Enable the REST Record Service (Beta) feature in Setup > Company > Enable Features to work with this record.
So I tried to enable the beta features but seems like its not possible currently.
i
Yeah, you'll need to use SuiteTalk or RestLets to add records to NS for now.