REST API to get lead by lead Id | Community
Skip to main content
Jan 11, 2018 2:57 AM UTC
Solved

REST API to get lead by lead Id

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.
SanfordWhiteman
SanfordWhitemanAccepted solution
Level 10
Jan 11, 2018 7:30 AM UTC

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...

4 replies

SanfordWhiteman
Level 10
Jan 11, 2018 4:13 AM UTC

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

Translate
Jan 11, 2018 6:42 AM UTC

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.

Translate
SanfordWhiteman
SanfordWhitemanAccepted solution
Level 10
Jan 11, 2018 7:30 AM UTC

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...

Translate