Search code examples
postmanpostmatesx-www-form-urlencoded

Postmates, How to create a list inside a application/x-www-form-urlencoded parameter


I'm trying to work with an API which is lightly documented here: https://postmates.com/developer/docs/#resources__delivery__create-delivery

It uses multipart form data (x-www-form-urlencoded).

They also have a tutorial here, kind of, for using Postman to test: https://blog.postmates.com/testing-the-postmates-api-with-postman-1d4c55336e85

The issue I'm having is with this "manifest_items" field. The documentation simply describes this as "List of items being delivered." and it has an "Attributes" link that goes nowhere. However, in the example response the manifest_items looks like it should contain sub elements (name, quantity, size). And in the tutorial's response there is a fourth (additional_data). Also in the tutorial, which uses Postman, you can see the value in the manifest_items field, which is [...

This makes me think it might be a array. Anyway, how do you define a value like this in a multipart for data parameter? I've tried a number of ways using Postman and Talend API tester. I don't see a GUI method. One example is placing "size=small&name=bag&quantity=2" into the field value.

Regardless of what I do, here is the response from Postmates:

{"kind":"error","code":"invalid_params","message":"The parameters of your request were invalid.","params":{}}

Any ideas here?

Thanks,

Ben


Solution

  • Here is the format they're looking for in the manifest_items field:

    [
        {
            "name": "Jake",
            "quantity": 2,
            "size": "medium"
        }
    ]