Help

Save the date! Join us on October 16 for our Product Ops launch event. Register here.

Make.com issue {"error":{"type":"INVALID_REQUEST_BODY","message":"Could not parse request body"}}

Solved
Jump to Solution
6019 7
cancel
Showing results for 
Search instead for 
Did you mean: 
Edward1976
6 - Interface Innovator
6 - Interface Innovator

I am trying to make a very simply patch request using an HTTP module in Make.com. However, I'm getting this and can't work out why:

 

    • URL
    • Request content
      { "fields": { "PDF Requested": true }, "typecast": true } ​
    • Request compressed content
      false
    • Method
      patch
    • HeadersArray
      • 1Collection
        • Name
          Authorization
        • Value
          Bearer keyoffNKf3BVBTr7w
      • 2Collection
        • Name
          Content-Type
        • Value
          application/json
    • Timeout
      empty
    • Use Mutual TLS
      false
    • Password
      empty
    • User name
      empty
    • Body type
      raw
    • Content type
      application/json
    • Serialize URL
      false
    • Share cookies with other HTTP modules
      false
    • Parse response
      false
    • Follow redirect
      true
    • Disable serialization of multiple same query string keys as arrays
      false
    • Follow all redirect
      false
    • Reject connections that are using unverified (self-signed) certificates
      true
OUTPUT

 

  • Bundle 1Collection
    • Status code
      422
    • HeadersArray
    • Cookie headersArray
      • 1
        AWSALB=HA7u9TAS1egeTJzD1uCdgufpkjhpW35UNtWpX1KTXq9u9oPC38wYlXSfBC3Mg01aHUYv4vtXUve1qdnCPo31ECjur8aMfS0suXN21pwZR97jcgoSboI9ykxlIoEs; Expires=Mon, 23 Oct 2023 13:37:26 GMT; Path=/
      • 2
        AWSALBCORS=HA7u9TAS1egeTJzD1uCdgufpkjhpW35UNtWpX1KTXq9u9oPC38wYlXSfBC3Mg01aHUYv4vtXUve1qdnCPo31ECjur8aMfS0suXN21pwZR97jcgoSboI9ykxlIoEs; Expires=Mon, 23 Oct 2023 13:37:26 GMT; Path=/; SameSite=None; Secure
      • 3
        brw=brw9wANfBLU9NABRU; path=/; expires=Wed, 16 Oct 2024 13:37:26 GMT; domain=.airtable.com; samesite=none; secure
    • Data
      {"error":{"type":"INVALID_REQUEST_BODY","message":"Could not parse request body"}}
    • fileSize
      82

 

I can easily achieve this using curl:

edwardnewton@Edwards-MacBook-Pro Downloads % curl -X PATCH \

  "https://api.airtable.com/v0/appzYqJSdNkXvYunc/2023/rec1e8DfKYXPzWJev" \

  -H "Authorization: Bearer xxxxxxxxxxxxxx" \

  -H "Content-Type: application/json" \

  -d '{

    "fields": {

      "PDF Requested": true

    }

  }'

 

{"id":"rec1e8DfKYXPzWJev","createdTime":"2023-10-12T00:55:02.000Z","fields":{"Name":"MOLLY SEIDEL","Finish Time":"02:23:07","Bib":114,"Pos":60,"Marathon ID":"recquo4BsycGtqNH2","recordId":"rec1e8DfKYXPzWJev","Year":"2023","Title":"THE CHICAGO MARATHON","Distance":"26.2M","Link":"https://pbposters.com/products/the-chicago-marathon?racer_id=rec1e8DfKYXPzWJev&base=appzYqJSdNkXvYun...","PDF Requested":true}}%  

 

Has anyone got any ideas or how to debug?

1 Solution

Accepted Solutions
Edward1976
6 - Interface Innovator
6 - Interface Innovator

FYI managed to get it working. Can't be certain but I'm pretty sure it was due to whitespace in the the body of my json.🙄 Pretty irritating how something so trivial can hold you up for days. Surely there's got to be smarter ways of debugging stuff like this than endless guess work. anyway, sorted!

See Solution in Thread

7 Replies 7

Have you tried using Make's native Airtable modules instead of writing your own code?

Hi Scott, appreciate the quick reply..and yes, the issue with the airtable modules in Make (for my use case) is that there's no option to map the base. I need to dynamically update. I just really struggling to dubug - any ideas? 

You said it works with CURL... can you get it to work properly in Postman?

If so, post 2 screenshots below: (1) How you've got it setup in Postman, and (2) How you've got it setup in Make's HTTP "Make A Request" module. Documentation on this page.

Edward1976
6 - Interface Innovator
6 - Interface Innovator

Hey Scott, yup works perfectly in Postman too. I thought it may be a header issue so added some more but that hasn't fixed it either. Attached are screenshots of input and output in Make and postman. Hope you can help!!

You didn't show a screenshot of how you setup your HTTP module in Make, but you don't want to be sending all those different headers to Airtable. You only want to send the authorization & the content-type in the header.

Here is Airtable's REST API documentation on how to update a record in Airtable -- check out the sample request in the right margin: https://airtable.com/developers/web/api/update-record

Edward1976
6 - Interface Innovator
6 - Interface Innovator

FYI managed to get it working. Can't be certain but I'm pretty sure it was due to whitespace in the the body of my json.🙄 Pretty irritating how something so trivial can hold you up for days. Surely there's got to be smarter ways of debugging stuff like this than endless guess work. anyway, sorted!

It's possible that it was improper whitespace! In Make's HTTP documentation, they suggest running your JSON code through a JSON validator such as https://jsonlint.com/ to make sure that your JSON is valid.

Also, I would remove all the extraneous headers from your API request to make sure that it continues to work flawlessly in the future.