Matthew Volpe
Matthew Volpe

Reputation: 51

Getting HttpError 400 "Request contains an invalid argument" when accessing Google Keep Api

I am trying to create a note via a python script, but keep getting this error. If I knew which argument was invalid I could fix it, but this is a very vague error message. My script uses a service account and client side file to authenticate, and it seems like I am getting through authentication as I am seeing requests to the api come through in the Cloud Developer Console.

Here is the Body of the note:

{
    "body": {
        "list": {
            "listItems":[
                {
                    "checked": False,
                    "text": 
                        {"text": "Tester Text 1"}
                },
                {
                    "checked": False,
                    "text":
                        {"text": "Tester Text 2"}
                }
                ]
            }
        }, 
    "title": "Testing Title"
}

I have tried adding the additional parameters included in the Body section of the Google Keep API create method under the notes resource, but still receive the same message. I have also tried messing with some of the authentication parameters in the service account file, but get the same error.

After some more troubleshooting I have tried sending the request as a json encoded string and then upon checking the request actually being sent, the request body is produced with 3 forward slashes in front of every element of the json payload. The request is being generated by the google api client library, so I am not sure what to do next.

Upvotes: 2

Views: 658

Answers (0)

Related Questions