Ok, some progress, I managed to get the logs to ap...
# integrations
a
Ok, some progress, I managed to get the logs to appear now. But its just giving me a vague
Invalid Signature
error. But there doesn't appear to be any documentation around what that error actually means or how to generate a signature for just a rest call. I see restlets and SOAP call documentation for at least the header construction but nothing about signature generation outside the ones for Step One and Three of the TBA Authorization flow. I am using C# if anyone has some signature examples at all for this TBA stuff.
b
invalid signature means that you are messing up the generation of the oauth_signature
your first attempt should never be to try to implement anything crypto related yourself
TBA is essentially OAuth 1, so you should be looking for libraries that support OAuth 1
The usual recommendation for C# is https://restsharp.dev/
expect to spend some time learning all the parameters offered, you will need to set more unusual parameters like the realm and signature method
a
@battk Yeah but they don't actually explain how it's wrong and they don't explain how to generate one which is the issue. Thanks for the suggestion on the library but unfortunately that does not appear to support HmacSha256 which is now a requirement. None of the OAuth 1 libraries I managed to find support it. So what I've done tonight is pull down an OAuth 1 library and have pulled out the code and am trying to retrofit HmacSha256 into it. Though that is also not working very well.
b
look closer at the supported signature methods
if you still want to generate your own, you can go through The Signature for Web Services and RESTlets and the related RESTlet Base String
depending on how technical you are, rfc5849 contains enough information to implement the signature
honestly your approach of modifying an existing library should be better than trying to implement it yourself
a
Hmm, we are also Using Refit everywhere else so I need to tie this into that.
I just tried modifying the OAuth library native to dotnet and got the same signature error.
b
you may actually want to try postman first to make sure that you know valid values for all the different parameters
postman can be used with restlets
a
I don't really have any of those setup. Honestly this is my first time using Netsuite and I just want to hit the REST Apis with this header.
a
Well, I have tried implementing two different OAuth libraries now. Both have given me the same invalid signature. I am not convinced this works at all.
b
start with postman
convince yourself that it is indeed possible to use TBA
a
Just downloaded it and set it up, same error with their postman collection. Invalid Signature. I just requested a new access token and secret from the TBA flow so all the values are pretty new and I can successfully request the token just not...use it.
b
which values did you fill in for the environment
a
All of them, Account Id, Client Id, Client Secret, Token Id (which I assume is just the token?), Token Secret, and Company Url
b
basically the only one there that can easily be copy and pasted wrong is the account id
so make sure to use the exact id from the Company Information
id also double check the ids of the environment, netsuite doesnt use client id or client secret in its tba
a
It requires the consumer secret and consumer key, which are just the client id and client secret of the integration, they are listed under both names.
Also, from the postman docs: • If your server requires an 
HMAC
 or 
PLAINTEXT
 signature, Postman will provide Consumer Key, Consumer Secret, Access Token, and Token Secret fields.
b
client id and client secret are the names of the parameters when used with oauth 2, which may suggest that you were playing with the authentication settings
consumer secret and keys are used with OAuth 1/TBA
s
@Alex you can have a look at example from my PoC. Code itself might not be good as I'm not a C# developer but it can give you an idea about the signature generation and http request: https://github.com/nserpsolutions/uipath-rest-connector/blob/345642ccbe47d653ac951[…]estletConnector.Activities/Activities/NetSuiteProcessRestlet.cs