Hi Could some please suggest when we should use Re...
# suitetalkapi
c
Hi Could some please suggest when we should use RestLet over Rest API. As per my understanding Rest API provides access to Standard/Custom Records, (actions/SQL), but if we want to customize or Integrate as per third party needs (lets say Third party needs to send some specific data with NetSuite) can we use Rest APIs? I am assuming as there is no generic endpoint to accommodate above requirement we should use RestLet instead. Please correct me if I am wrong.
b
both restlets and the rest api wont help you if your third party cant make an integration specific to netsuite
the authentication method that netsuite implements are non standard enough that its unlikely that a generic request will work
it sounds like you are working with a webhook, which will usually involve sending data to middleware
in rare cases an external suitelet might work
c
Thanks @battk, here we need to listen to external app which will send data to NetSuite and process it internally. so some way we have to expose Api to them. For Authentication we are suggesting to use OAuth2.0 or token bases as mentioned in Netsuite help.
b
still sounds like a webhook
c
as we can't extend Rest API thinking about RestLet, but it will not have api paths for different operations, either we have to use different RestLet for each operation or Rest body should differentiate yet
Yes @battk, like a webhook
b
keep in mind that netsuite's oauth 2 implementation uses refresh tokens that expire in 7 days
and TBA is basically oauth 1, which is extra rare
c
yeah when i tried in postman it was OAuth1 🙂
TBA tokens will never expire right if generated from Access tokens path? (until we revoke)
b
correct, TBA tokens dont expire
c
As i read some where external Suitelet will have Security concern as it is publicly exposed without Login
so thought of RestLets
b
if they can handle the authentication behind it sure
keep in mind that webhooks essentially never work that way
🆗 1
id have your middleware options explored
c
but when it comes to accommodate many operations either we have to use multiple RestLets or in client has to tell though Rest Body, we can't expose paths like Rest APi right
b
kinda
depending on the http method, you may be able to use query parameters
c
yeah, GET and Delete accepting query params
b
usually does not matter for webhooks, most are posts
c
but post
needed in body only
b
posts dont support url query parameters
c
could you please throw some more light on "middleware options explored"?
b
send the data to another server
which then makes the request to netsuite
c
ah ok. but every customer should be provisioned to this middle ware (or we have to figure out and send request to appropriate account) if we distribute as suiteapp right? (just trying to understand)
b
potentially
would be pretty unusual from a suiteapp perspective
probably because you can just use the middleware to do the entire integration
c
Integration usually here is from one external account to one Netsuite account
i mean for each account one External account instance will be there.. so that specific external account instance will hold Netsuite Account details
b
not sure what you are talking about here
c
sorry, to give some more clear information, like our Nestuite account, external party has own instances that will be mapped to Netsuite accounts. so that it will maintain 1-1 . Now if we add one middleware as Integration point, external party has to tell to which Netsuite account it needs to communicate.
b
still not sure where there is going
your third party posts data to a specific url
presumably a different url for different account
c
correct @battk