- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Oct 16, 2023 09:04 AM
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 contentfalse
- Methodpatch
- HeadersArray
- 1Collection
- NameAuthorization
- ValueBearer keyoffNKf3BVBTr7w
- 2Collection
- NameContent-Type
- Valueapplication/json
- Timeoutempty
- Use Mutual TLSfalse
- Passwordempty
- User nameempty
- Body typeraw
- Content typeapplication/json
- Serialize URLfalse
- Share cookies with other HTTP modulesfalse
- Parse responsefalse
- Follow redirecttrue
- Disable serialization of multiple same query string keys as arraysfalse
- Follow all redirectfalse
- Reject connections that are using unverified (self-signed) certificatestrue
- Bundle 1Collection
- Status code422
- HeadersArray
- Cookie headersArray
- 1AWSALB=HA7u9TAS1egeTJzD1uCdgufpkjhpW35UNtWpX1KTXq9u9oPC38wYlXSfBC3Mg01aHUYv4vtXUve1qdnCPo31ECjur8aMfS0suXN21pwZR97jcgoSboI9ykxlIoEs; Expires=Mon, 23 Oct 2023 13:37:26 GMT; Path=/
- 2AWSALBCORS=HA7u9TAS1egeTJzD1uCdgufpkjhpW35UNtWpX1KTXq9u9oPC38wYlXSfBC3Mg01aHUYv4vtXUve1qdnCPo31ECjur8aMfS0suXN21pwZR97jcgoSboI9ykxlIoEs; Expires=Mon, 23 Oct 2023 13:37:26 GMT; Path=/; SameSite=None; Secure
- 3brw=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"}}
- fileSize82
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?
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Oct 17, 2023 06:03 AM
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!
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Oct 16, 2023 09:53 AM
Have you tried using Make's native Airtable modules instead of writing your own code?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Oct 16, 2023 11:50 AM
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?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Oct 16, 2023 12:40 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Oct 17, 2023 04:59 AM - edited ‎Oct 17, 2023 05:03 AM
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!!
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Oct 17, 2023 05:43 AM
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
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Oct 17, 2023 06:03 AM
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!
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Oct 17, 2023 06:10 AM
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.