What is your goal?
Use my client credentials to connect to FedEx tracking API
What is the problem & what have you tried?
I took a working customs app for Amazon SP-API, changed the syntax and URL to match FedEx requirement. Any call I make with the FedEx module replies “Body is not a valid JSON” (see uploaded screenshot).
- the connection passed the validation
- I tested the call with regular HTTP module after manually obtaining an access token and it works fine with the same payload
Base:
{
// Default request configuration
"baseUrl": "https://apis.fedex.com",
"headers": {
"authorization": "Bearer {{connection.apiKey}}"
},
// Default response handling
"response": {
"error": {
"message": "[{{statusCode}}] {{body.error}}"
}
},
"log": {
"sanitize": [
"request.headers.authorization"
]
}
}
Module Communication:
{
"qs": {
"{{...}}": "{{toCollection(parameters.qs, 'key', 'value')}}"
},
"url": "{{parameters.url}}",
"body": "{{parameters.body}}",
"type": "text",
"method": "{{parameters.method}}",
"headers": {
"{{...}}": "{{toCollection(parameters.headers, 'key', 'value')}}"
},
"response": {
"output": {
"body": "{{body}}",
"headers": "{{headers}}",
"statusCode": "{{statusCode}}"
}
}
}
Module Mappable Parameters:
[
{
"name": "url",
"type": "text",
"label": "URL",
"required": true
},
{
"name": "method",
"type": "select",
"label": "Method",
"default": "GET",
"options": [
{
"label": "GET",
"value": "GET"
},
{
"label": "POST",
"value": "POST"
},
{
"label": "PUT",
"value": "PUT"
},
{
"label": "PATCH",
"value": "PATCH"
},
{
"label": "DELETE",
"value": "DELETE"
}
],
"required": true
},
{
"name": "headers",
"spec": [
{
"name": "key",
"type": "text",
"label": "Key"
},
{
"name": "value",
"type": "text",
"label": "Value"
}
],
"type": "array",
"label": "Headers",
"default": [
{
"key": "Content-Type",
"value": "application/json"
}
]
},
{
"name": "qs",
"spec": [
{
"name": "key",
"type": "text",
"label": "Key"
},
{
"name": "value",
"type": "text",
"label": "Value"
}
],
"type": "array",
"label": "Query String"
},
{
"name": "body",
"type": "any",
"label": "Body"
}
]
Error messages or input/output bundles
I looked at the input bundle and everything looks normal. The character encoding seems to suggest something to do with gzip compression but the API doesn’t use gzip compression. Has anyone encountered anything similar?
