SOLVED

Re: API Isn't Creating a Program

Go to solution
Neil_Davis
Level 1

API Isn't Creating a Program

I'm attempting to create a program using the Marketo REST API. I seem to get a 200 response without a response body. Can someone help me understand what the problem might be?

 

API Route: POST /rest/asset/v1/programs

Request Body:

{
        "type": "Default",
        "channel": "Nurture Email",
        "name": "EmailProgramTest",
        "folder":
        {
            "type": "Folder",
            "id": 619900
        },
        "costs":
            [
                {
                    "startDate":"2022-01-01",
                    "cost":2000
                }
            ]
    
}
1 ACCEPTED SOLUTION

Accepted Solutions
Jay_Jiang
Level 10

Re: API Isn't Creating a Program

create program endpoint takes form data not json. as per the example in api docs, your payload should be something like:

name=EmailProgramTest&folder={"id":619900,"type":"Folder"}&type=Default&channel=Nurture Email&costs=[{"startDate":"2022-01-01","cost":2000}]

 

p.s. that's a really big number for folder id...

View solution in original post

1 REPLY 1
Jay_Jiang
Level 10

Re: API Isn't Creating a Program

create program endpoint takes form data not json. as per the example in api docs, your payload should be something like:

name=EmailProgramTest&folder={"id":619900,"type":"Folder"}&type=Default&channel=Nurture Email&costs=[{"startDate":"2022-01-01","cost":2000}]

 

p.s. that's a really big number for folder id...