Getting Error when Making API Call in Zoho Creator to FreightCom API

Getting Error when Making API Call in Zoho Creator to FreightCom API

I want to make an API connection between my Zoho Creator app and the FreightCom API. Here is the code for my function:

```
string FreightComTest()
{
apiKey = "This is my API KEY. I have hidden it for security reasons.";

// Define your request headers, including the authentication header
headers = {"Content-Type": "application/json", "Authorization": apiKey};

// Define your request body (if needed)
requestBody = {}; // This is where my request body is.

response = invokeurl (endpointUrl, "POST", requestBody, headers, false);
return response;
}
```

Here is a link to the documentation for the freightcom api:

In the API documentation text file that they provided me, this is the authorization schema:

```
"components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization"
      }
    },
```


Here is the error I am getting returned:
```
{
   "responseText":{
      "message":"Authorization header requires 'Credential' parameter. Authorization header requires 'Signature' parameter. Authorization header requires 'SignedHeaders' parameter. Authorization header requires existence of either a 'X-Amz-Date' or a 'Date' header. Authorization=9rJMtYMn1kqmJFimPqeC3JHt4fgEnROC9D83Cm7JTB6W26f93sIB1OgvhaGgemmn"
   },
   "responseHeader":{
      "date":"Sun, 25 Feb 2024 07:32:55 GMT",
      "content-length":"341",
      "x-amz-apigw-id":"Trn-SFpJCYcEIUg=",
      "x-amzn-errortype":"IncompleteSignatureException",
      "x-amzn-requestid":"cb927fcf-bdfe-4fe2-88c8-1d3895d31e7a",
      "content-type":"application/json",
      "connection":"keep-alive"
   },
   "responseCode":403
}
```

When I ran this through ChatGPT, it says that the API expects requests to be signed with AWS Signature Version 4.

I would prefer not to have to do this.

Anyone know a way around this?

    Access your files securely from anywhere







                            Zoho Developer Community




                                                  • Desk Community Learning Series


                                                  • Digest


                                                  • Functions


                                                  • Meetups


                                                  • Kbase


                                                  • Resources


                                                  • Glossary


                                                  • Desk Marketplace


                                                  • MVP Corner


                                                  • Word of the Day


                                                  • Ask the Experts





                                                            Manage your brands on social media



                                                                  Zoho TeamInbox Resources



                                                                      Zoho CRM Plus Resources

                                                                        Zoho Books Resources


                                                                          Zoho Subscriptions Resources

                                                                            Zoho Projects Resources


                                                                              Zoho Sprints Resources


                                                                                Qntrl Resources


                                                                                  Zoho Creator Resources



                                                                                      Zoho CRM Resources

                                                                                      • CRM Community Learning Series

                                                                                        CRM Community Learning Series


                                                                                      • Kaizen

                                                                                        Kaizen

                                                                                      • Functions

                                                                                        Functions

                                                                                      • Meetups

                                                                                        Meetups

                                                                                      • Kbase

                                                                                        Kbase

                                                                                      • Resources

                                                                                        Resources

                                                                                      • Digest

                                                                                        Digest

                                                                                      • CRM Marketplace

                                                                                        CRM Marketplace

                                                                                      • MVP Corner

                                                                                        MVP Corner









                                                                                          Design. Discuss. Deliver.

                                                                                          Create visually engaging stories with Zoho Show.

                                                                                          Get Started Now


                                                                                            Zoho Show Resources

                                                                                              Zoho Writer

                                                                                              Get Started. Write Away!

                                                                                              Writer is a powerful online word processor, designed for collaborative work.

                                                                                                Zoho CRM コンテンツ



                                                                                                  Nederlandse Hulpbronnen


                                                                                                      ご検討中の方