Rest API error code 601, Access token invalid | Community
Skip to main content
February 6, 2015
Solved

Rest API error code 601, Access token invalid

  • February 6, 2015
  • 5 replies
  • 5099 views
Hey guys,

I'm tryin to insert leads via rest api and am getting an access token invalid error. I've verified the token and I believe everything is formatted properly...

URL: https://XYZ.mktorest.com/rest/v1/leads.json?access_token=some_verified_token
HTTP Headers: Authorization: Bearer: some_verified_token

HTTP body:
{"Action":"createOnly",
"lookupField":"email",
"input":[
{"email":"aaron@blahblah.com"},
{"email":"will@blahblahblah.com"},
{"email":"yigit@blahblahblahblah.com"}]
}

Any help would be appreciated. Thanks!
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by
1 - Keep the access token in the URL and remove it from the header. The 612 error means you are on the right track here. In othe words, you solved the 601 error, so you are seeing the other error you need to solve to get this working. 
2 - To address the 612 error, you need to add a Content-Type HTTP header. You need to set it to application/json. See this StackOverflow question for more info:
http://stackoverflow.com/questions/28181325/why-invalid-content-type
 

5 replies

February 6, 2015
I would trying removing the colon after Bearer (but keeping the colon after Authorization), then retry the request. 

You only need to include the access token into either the Header or as a parameter. Not both. 
February 6, 2015
Murtza - thanks! The extra colon was a typo when I typed my question...

So, if I remove the header, then I get "invalid content type," (code 612) which would lead me to believe that a header is required.

If I remove the token from the URL, then I get code 600 - "Access token not specified"

As with before, if I use both, then I get "Invalid Access Token."

Thanks agian for your help - I've been working at this for awhile.
Accepted solution
February 6, 2015
1 - Keep the access token in the URL and remove it from the header. The 612 error means you are on the right track here. In othe words, you solved the 601 error, so you are seeing the other error you need to solve to get this working. 
2 - To address the 612 error, you need to add a Content-Type HTTP header. You need to set it to application/json. See this StackOverflow question for more info:
http://stackoverflow.com/questions/28181325/why-invalid-content-type
 
February 7, 2015
Murtza - thanks again for the response. I figured that out: needed "Content-Type: application/json"

I coudln't find it anywhere in the api documentation...
February 7, 2015
Glad you got it working! Just updated the REST API error code documentation with this info.