Best answer

Conver cURL to Post with Customer Request

  • 20 July 2023
  • 1 reply
  • 121 views

Hi there, I am trying to convert the following cURL POST request to a webhook by Zapier (tried both Custom Request option and the POST option) and I’ve been having some trouble. Would love to know what I’m doing wrong! In my production instance, I have updated <YOUR_API_KEY> with the relevant value.

 

cURL request:

curl --request POST \
'https://predict.vellum.ai/v1/generate' \
--header 'accept: application/json' \
--header 'X-API-KEY: <YOUR_API_KEY>' \
--header 'content-type: application/json' \
--data-raw '{
    "deployment_name": "km-test-zapier-1",
    "requests": [
        {
            "input_values": {
                "context_str": "<your-context_str-value>",
                "query_str": "<your-query_str-value>",
                "anti_context_str": "<your-anti_context_str-value>",
                "raw_data": "<your-raw_data-value>"
            }
        }
    ]
}'

 

Zapier screen shot:

 

I’m getting the following error: “JSON parse error - Expecting value: line 1 column 1 (char 0) (HTTP Status Code: 400)”

I suspect I’m not doing something correctly with the quotation marks and so it’s not able to read the above as JSON but I’m not sure where to fix that. When I run the cURL request on my Terminal, it works fine!

icon

Best answer by Troy Tessalone 21 July 2023, 00:16

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

1 reply

Userlevel 7
Badge +14

Hi @kothariy 

Good question.

Try this…

Remove remove the lead --data-raw ‘

Remove the trailing ‘

The Data should start and end with { }