Bharath
Bharath

Reputation: 213

What is wrong with this OAuth header?

This is the OAuth header I have generated using OAuth1.0 Library. Given below .

 {"Authorization":"OAuth realm=\"TSTDRV1606019\",oauth_consumer_key=\"c85f08d536fb43ffbf199896b970af6cc8ae3b9ffbd4d5a8d7bd35c36bbc58be\",oauth_nonce=\"PxTkoW9AHGgo36obe2qL\",oauth_signature=\"60eebfff6843f7fb652f98ce6dd65fe025d9837e\",oauth_signature_method=\"HMAC-SHA1\",oauth_timestamp=\"1497605488\",oauth_version=\"1.0\"","content-type":"application/json"} 

I keep getting a USER_ ERROR like below

 "error" : {"code" : "INVALID_REQUEST", "message" : "The request could not be understood by the server due to malformed syntax."}}

Can anyone please tell me where I am going wrong ?

Appreciate all the help !

Upvotes: 2

Views: 3797

Answers (3)

Dr. Ernie
Dr. Ernie

Reputation: 547

I have no clue why, but after fixing the SHA to 256 I was still getting the malformed syntax error when calling from Postman until I set the Advanced -> Version to "1.0" (NOT "1").

Authorization -> Advanced -> Version

Upvotes: 0

Chinna
Chinna

Reputation: 101

AS of Netsuite release 2021.2, the TBA(Token Based Authentication) with HMAC-SHA1 signature method gets deprecated. And users who actively use HMAC-SHA1 have to switch to HMAC-SHA256. Otherwise, the user may find the below error with 4xx error code

{
  "error": {
    "code": "INVALID_REQUEST",
    "message": "The request could not be understood by the server due to malformed syntax."
  }
}

Upvotes: 10

Krypton
Krypton

Reputation: 5286

Not sure if this is the only problem, but it looks like you're missing your oauth_token. See Required Data for Using TBA with RESTlets

Upvotes: 0

Related Questions