Re: Adding tokens to a program using REST API

Nilesh_Darji1
Level 1

Adding tokens to a program using REST API

Hi,

I am trying to update a program using REST api. The api call seems to be working because program name does get updated but tokens are not getting added. Is there any issue with way I am sending token information?

URL:  https://456-QRK-012.mktorest.com/rest/asset/v1/programs.json

Payload:

name=Test 1(Updated)&tokens:[{"name":"Subject","value":"Test Email"},{"name":"FromEmail","value":"nilesh@homeunion.com"},{"name":"FromName","value":"Nilesh D"}]

Thanks

Nilesh

1 REPLY 1
SanfordWhiteman
Level 10 - Community Moderator

Re: Adding tokens to a program using REST API

You're using the wrong endpoint. The docs show you how this is actually done: https://developers.marketo.com/rest-api/assets/tokens/#create_and_update 

Also, please highlight any code you post here using the Syntax Highlighter so it's readable. Choose Language = JavaScript for JSON. When pasting URLs as part of a code query it's also better to highlight them (as Language = None) so they're not automatically linked.

pastedImage_1.png