Hi All, I created one restlet. The endpoint is wor...
# suitescript
v
Hi All, I created one restlet. The endpoint is working correctly when I'm making request from the postman but then the same endpoint is not working when the request is coming from the thirdparty. Below is the error showing in the third party console.
Status: Error
• HttpStatusCode: 403 • Message: ◦ ForbiddenNewtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: e. Path '', line 0, position 0. ◦
at Newtonsoft.Json.JsonTextReader.ParseValue()
at Newtonsoft.Json.JsonReader.ReadForType(JsonContract contract, Boolean hasConverter)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonSerializer.Deserialize[T](JsonReader reader)
at ProviderOpenProxy.Common.StreamExtensions.ReadAndDeserializeFromJson[T](Stream stream) in D:\Agents\2\inContact\BF22.2.0.x-VC\src\Code\C#\Services\VCSvc\Providers\ProviderOpenProxy\Common\StreamExtensions.cs:line 35
at ProviderOpenProxy.Clients.HttpResponseToOpenProxyResponse.From(HttpResponseMessage response, String verb) in D:\Agents\2\inContact\BF22.2.0.x-VC\src\Code\C#\Services\VCSvc\Providers\ProviderOpenProxy\Clients\HttpResponseToOpenProxyResponse.cs:line 72
c
are they sending the content type as application/json in the header?
v
yes @creece
c
I'd set a breakpoint if you can and see what the request is coming in as. Its gotta be some kind of malformed requests data as it can't parse it.
b
your third party needs better error logging
they need to log what the response body is if json parsing fails
the only thing you have to go from is the 403 status code, which is what you get for things like invalid login attempts
the response body should tell you what the actual problem is
v
@battk Thanks for the details. I could see the request in the login audit trial record. There it say's Invalid signature. I spoke to third party team and It seem's like they are passing correct information. I'm not sure where the exact error was.
{'Content-Type':'application/json','Authorization':'OAuth realm="5423977_SB1",oauth_consumer_key="actual consumer key",oauth_token="actual token",oauth_signature_method="HMAC-SHA256",oauth_timestamp="1655906910",oauth_nonce="AH9GrBQA6UyKefLviZyR",oauth_version="1.0",oauth_signature="fiPntkH30mEAY9LcD9zjC1ZlucCgP497589tSFIWI1I%3D"'}
Here is the header information they are passing to NetSuite.
@battk Do you see any Issues here?
b
calculate the signature yourself and compare
postman allows you to specify the timestamp and nonce so you can compare