Re: Create/Update Tokens via REST API

Nicholas_Fritch
Level 1

Create/Update Tokens via REST API

Hi I am trying to create/update tokens in a folder using this reference https://developers.marketo.com/rest-api/assets/tokens/

I have made a post request in python as per the url 442-whj-204.mktorest.com/rest/asset/v1/folder/{folder id}/tokens.json?access_token={token}

with the header as content type application/x-www-form-urlencoded and data passed as per instructed, however I get an error code 600 access token not specified. 

I use the same format for the bulk activity download with no problems

Is there a different way to provide the access token for this type of request?

Thanks,

Tags (1)
2 REPLIES 2
SanfordWhiteman
Level 10 - Community Moderator

Re: Create/Update Tokens via REST API

Use the Authorization header:

Authorization: Bearer {{access_token}}

In theory the query param should be supported as an alternate, but I've never found a need for it.

Jep_Castelein2
Level 10

Re: Create/Update Tokens via REST API

Also, you could consider using https://github.com/jepcastelein/marketo-rest-python/, which abstracts away a lot of the API details.