Articles in this section

Connect to custom NetSuite RESTlets

By default, the integrator.io NetSuite connection communicates via custom RESTlets in the Celigo integration bundle. However, you can route your connection to a different NetSuite RESTlet by specifying HTTP headers in integrator.io API exports or imports, acting as a proxy for requests to your NetSuite connection. 

Note: See Set up an OAuth 1.0 connection to NetSuite SuiteTalk APIs (including SuiteQL) to set up a connection to SuiteQL.

Setup

A. Configure your NetSuite connection

First, create or edit a standard NetSuite connection. Record the connection ID at the end of the URL for use below as the NetSuite connection ID.

B. Establish an integrator.io (application) connection

Next, set up an integrator.io connection. Note that integrator.io API tokens last for only one hour, unless your account has the API Management feature enabled.

C. Retrieve RESTlet parameters

Before you can interact with the RESTlet, you must get the Script ID and Deployment ID from the NetSuite script record.

Export (read) from a RESTlet

In Flow Builder, create an export to the application integrator.io, selecting the integrator.io connection that you just created. Define the export as follows:

Name: Give the export a name.

Form view: Choose REST API.

HTTP method: Choose POST.

Headers

name suggested value
Integrator-NetSuite-ScriptId The Script ID from above
Integrator-NetSuite-DeployId The Deployment ID from above
Integrator-Method The method to use with your RESTlet call, most likely GET for an export

Relative URI: Enter the proxy URI for your NetSuite connection, referencing your NetSuite connection ID that you copied above, in the format, /v1/connections/<id>/proxy.

HTTP request body: Enter an empty JSON object, {}.

Export type: Choose All.

Click Preview to see your RESTlet data. 

Import (write) to a RESTlet

In your flow, create an import using the integrator.io application and the connection to it that you built earlier. Define the import as follows: 

Name: Give the import a name.

Form view: Choose REST API.

HTTP Method: Choose POST.

Headers: 

name suggested value
Integrator-NetSuite-ScriptId The Script ID from above
Integrator-NetSuite-DeployId The Deployment ID from above
Integrator-Method The method to use with your RESTlet call, most likely POST for an import

Relative URI: Enter the proxy URI for your NetSuite connection, referencing your NetSuite connection ID that you copied above, in the format, /v1/connections/<id>/proxy.

Now, within this import the integrator.io connection functions like any other REST connection. You can specify a request body in the HTTP request body setting, or you can use regular field mapping. If you go with the latter, you can provide a sample request under Do you have a sample destination record? in the import settings to make mapping easier.

Was this article helpful?
1 out of 1 found this helpful

Comments

11 comments
Date Votes
  • I've been unable to figure out how to pass parameters to the RESTlet. I've tried adding them to the HTTP headers, to the request body and to the URL as params. My RESTlet isn't seeing any of the parameters.

    Is it possible?

    0
  • Hi, Steve Klett. Thanks for sharing your results here. 

    If you haven't tried this yet, as a start, can you turn on connection debugging and verify that the parameters are getting sent correctly from the integrator․io side? 

    ===================
    Steve Klett, updated 3/15/2022 from a developer lead asked a similar question:

    At present, query parameters are supported only for GET calls.
     
    You can pass them as an object in body.query.
    0
  • I'm not sure why this over complication is required? The standard HTTPS request should handle call to RESTlet. 

    0
  • Aleks Frolovs for now this is the only way to connect to restlets. However, our April release should include an update to our generic HTTP connector that allows OAuth 1 with realm. Currently, we have OAuth 1 for generic HTTP connections, but don't have the realm field available. Stayed tuned!

    cc Bhavik Shah

    0
  • Aleks Frolovs, I have this working in my environment. Can you screenshot your setup? Additionally, we have office hours today. If you can join, then we can check it out together. https://zoom.us/meeting/register/338c30f6ce7573eacde7dc3c8da9331e
    https://docs.celigo.com/hc/en-us/articles/360045798291

    0
  • Aleks Frolovs what's the error you are getting? Also, I assume the connection id you are using is a valid NetSuite connection id in Celigo? Does authenticated user's role for the NetSuite connection in Celigo have access to the script deployment?

    0
  • Thank you for helping me to sort out the issue. I should have contacted you earlier. 

    0
  • Aleks Frolovs no problem. In case others come here in the future, the connection id in the relative url needs to be the NetSuite connection id.

    Relative URI: Enter the proxy URI for your NetSuite connection, referencing your NetSuite connection ID that you copied above, in the format, /v1/connections/<id>/proxy.

    0
  • ... our April release should include an update to our generic HTTP connector that allows OAuth 1 with realm. Currently, we have OAuth 1 for generic HTTP connections, but don't have the realm field available. Stayed tuned!

    Tyler Lamparter I've been eagerly awaiting the April release so we can call RESTlets without the complexity of what's described in this document. I was just reviewing the release notes from Yesterday and I don't see anything about the realm added to the HTTP connector.

    Is it simply not mentioned because it's minor or is it not making it in the April release?

    0
  • Steve Klett yes it is making into April release. The only change is to add realm parameter into OAuth 1 authentication so it may just not be added to the release notes. I am working with the doc team to get a new article for connecting to SuiteTalk apis (in order to run SuiteQL queries) and we can also update this doc to reflect the new option for RESTlets. In case you're curious, here is the setup I have in QA.

    0
  • Hi Tyler Lamparter Nice! I am curious so thank you for sharing the QA shots. I'm looking forward to using it when released. I've got a project that will make immediate use of it.

    0

Please sign in to leave a comment.