Send HTTP Request to Perfex CRM Rest API

I am attempting to send an HTTP POST request to my Perfex CRM Rest API. I have authenticated successfully, but I am unable to save a new Lead from AirTable to Perfex CRM. I am sending the data to the CRM from the body section, and my data is in JSON format. The link to the Perfex CRM Rest API Documentation is available here .

This is my JSON body code, as per the documentation.

{
  "source": "{{trigger['fields']['LeadSource']}}",
  "status": "Lead",
  "name": "{{trigger['fields']['Name']}}",
  "phonenumber":"{{trigger['fields']['Mobile']}}",
  "email":"{{trigger['fields']['Email']}}"
}

But I am getting this response from the API.

{
  "response": {
    "status": 404,
    "body": {
      "status": false,
      "error": {
        "name": "The Lead Name field is required.",
        "source": "The Source field is required.",
        "status": "The Status field is required."
      },
      "message": "<p>The Lead Name field is required.</p>\n<p>The Source field is required.</p>\n<p>The Status field is required.</p>\n"
    }
  },
  "request": {
    "body": {
      "source": "Google",
      "status": "Lead",
      "name": "ABID",
      "phonenumber": "03059002132",
      "email": "admin@bestlyhub.com"
    }
  }
}

What I am doing wrong, Any solutions?

@pointersoftware What are the results when you use static text like below and just for testing and remove the optional fields.

{
“source”: “source_test”,
“status”: “Lead_test”,
“name”: “name_test”
}

PLEASE DO NOT COPY, my apostrophes are changing…

Thanks for your answer, I solved the issue by adding Content-Type = application/x-www-form-urlencoded in the header.

2 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.