REST API to get lead by lead Id | Community
Skip to main content
January 11, 2018
Solved

REST API to get lead by lead Id

  • January 11, 2018
  • 1 reply
  • 3106 views

Hi

I try read info of lead with /rest/v1/lead/{leadId}.json and my just generated access token.

but i got

{"requestId":"1323#160e319bb3f","success":false,"errors":[{"code":"600","message":"Access token not specified"}]}

how can i get specified access token?

regards,

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 SanfordWhiteman

You use the /identity endpoint to get an OAuth bearer token using your client_id and client_secret.

You include that bearer token either as a query parameter (access_token=<token>) or as the HTTP Authentication: bearer <token> header.

And you need to expect the bearer token to expire within an hour, so you get a new one from /identity when that happens.

This is all quite clearly spelled out in the developer docs...

1 reply

SanfordWhiteman
New Participant
January 11, 2018

From the /identity endpoint... surely you were already doing this when working on the other REST API question you posted today?

January 11, 2018

Hi

thank you, replace "rest" to "identity", right?

but i change from

https://004-btr-463.mktorest.com/rest/v1/lead/3864423.json&access_token=key

to

https://004-btr-463.mktorest.com/identity/v1/lead/3864423.json&access_token=key

doesn't work

no, in fact, all i have to do is:

step 1: find changed lead record

step 2: read(get) them

step 3: update to my system.

now is on step 2.

SanfordWhiteman
SanfordWhitemanAccepted solution
New Participant
January 11, 2018

You use the /identity endpoint to get an OAuth bearer token using your client_id and client_secret.

You include that bearer token either as a query parameter (access_token=<token>) or as the HTTP Authentication: bearer <token> header.

And you need to expect the bearer token to expire within an hour, so you get a new one from /identity when that happens.

This is all quite clearly spelled out in the developer docs...