Luis Sardon
Luis Sardon

Reputation: 514

How do I use Marketo REST API with Postman?

I'm having a hard time trying to figure out how to properly use the Marketo REST API using Postman for testing purpose.

So far I can Authenticate and get my access_token,

but when I try to create a folder... (properly authenticated)

endpoint: [POST] /rest/asset/v1/folders.json

body:

{
  "description": "Test Folder",
  "name": "Test",
  "parent": {
    "id": 1,
    "type": "Folder"
  }
}

I get:

{
    "success": false,
    "errors": [
        {
            "message": "name cannot be null.",
            "code": "701"
        },
        {
            "message": "parent cannot be null",
            "code": "701"
        }
    ],
    "requestId": "408a#1720c00a893",
    "warnings": []
}

I don't know what I'm doing wrong.

Upvotes: 1

Views: 1949

Answers (1)

Denys Kurochkin
Denys Kurochkin

Reputation: 1497

See an example in the Marketo API documentation

Create/Update folder request should be an application/x-www-form-urlencoded not application/json

So in Postman, you have to post a form with three parameters:

parent={"id":416,"type":"Folder"}
name=Test 10 - deverly
description=This is a test

For the parent parameter you should specify a specific json-like text, which is a usual format for folderId

enter image description here

For generic folders (not programs) you can provide just integer id, without JSON structure, this is not recommended but can be used for manual API tests

Upvotes: 1

Related Questions