tripit / api

TripIt's API Documentation and Support Forum
http://www.tripit.com/developer
Other
47 stars 16 forks source link

Error 400 when creating a NoteObject #275

Closed brendabell closed 2 years ago

brendabell commented 2 years ago

I'm trying to create a note for a trip and I'm constantly getting the following response:

<Response>
    <Error>
        <code>400</code>
        <description>Input cannot be null or an empty string.</description>
    </Error>
</Response>

My request is as follows:

Content-Type: application/json

{
    "NoteObject": [
        {
            "trip_id": "<hidden>",
            "display_name": "Sunset",
            "DateTime": {
                "date": "2022-07-05",
                "time": "22:05:00",
                "timezone": "America/Juneau",
                "utc_offset": "-08:00"
            }
        }
    ]
}

I tried using XML, but it kept returning unsupported media type with Content-Type set to text/xml.

I know my token is active -- all calls to get trips and notes are succeeding. I registered my app for Full API Application.

What am I doing wrong?

brendabell commented 2 years ago

Never mind. The API documentation is extremely vague with its examples. I stumbled on the responses to https://github.com/tripit/api/issues/233 and that cleared things up.