SOLVED

Re: REST API to get lead by lead Id

Go to solution
Anonymous
Not applicable

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,

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: REST API to get lead by lead Id

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

View solution in original post

4 REPLIES 4
SanfordWhiteman
Level 10 - Community Moderator

Re: REST API to get lead by lead Id

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

Anonymous
Not applicable

Re: REST API to get lead by lead Id

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
Level 10 - Community Moderator

Re: REST API to get lead by lead Id

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

Anonymous
Not applicable

Re: REST API to get lead by lead Id