Pregunta

I'm POST'ing the following JSON to asana's "tasks" endpoint.

{
    "data": {
        "options": {
            "fields": [
                "name",
                "notes"
            ]
        },
        "workspace": <valid number>,
        "assignee": <valid number>
    }
}

It's giving me a "Invalid field" error every time. I've read through the API a few times now and this JOSN looks exactly how the API says it should. Any ideas?

Asana API for those of you who want to help out: Asana API Documentation

¿Fue útil?

Solución

(I work for Asana)

The "options" field is a sibling of the "data" field, not a child. This is mentioned in the docs, but perhaps we aren't providing clarifying examples to make it more obvious.

If you change your request to look like this:

{
    "options": {
        "fields": [
            "name",
            "notes"
        ]
    },
    "data": {
        "workspace": <valid number>,
        "assignee": <valid number>
    }
}

things should work.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top