Using Postman to build my command. Running the command I get a 401 = The request is unauthenticated. Please pass the correct auth code.
What is it finding that is unauthenticated?
There is a message "Please pass the correct auth credentials". The script already has the XM-Token_Authorization. This seems to be a duplication. I tried using No Auth, Basic Auth and Bearer token.
I am using variables which do not display here.
Some of the variables are:
- api_endpoint = faxus1.xmedius.com/faxservice/rest/v1/fax/send
{
"info": {
"_postman_id": "05737c55-d266-43b8-bb20-de1fb0e2ff34",
"name": "DHF-From Curl",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "9999",
"_collection_link": "https://****.postman.co/workspace/****'s-Workspace~60685b95-20ad-4038-89f0-025a4e9e496e/collection/9999-05737c55-d266-43b8-bb20-de1fb0e2ff34?action=share&source=collection_link&creator=9999"
},
"item": [
{
"name": "https://faxus1.xmedius.com/faxservice/rest/v1/fax/send",
"request": {
"auth": {
"type": "noauth"
},
"method": "POST",
"header": [
{
"key": "accept",
"value": "application/json"
},
{
"key": "XM-Token-Authorization",
"value": "{{your_authorization_token}}"
}
],
"body": {
"mode": "formdata",
"formdata": [
{
"key": "attachment",
"contentType": "application/pdf",
"type": "file",
"src": "/C:/KT/Fax/test file 2.pdf"
},
{
"key": "metadata",
"value": "{\n "faxOptions": {},\n "userId": "{{app_user_id}}",\n "subject": "{{subject}}",\n "recipients": [\n {\n "number": "{{fax_number}}",\n "name": "{{recipient}}"\n }\n ],\n "comment": "{{comment}}"\n}",
"contentType": "application/json",
"type": "text"
}
]
},
"url": {
"raw": "https://{{api_endpoint}}",
"protocol": "https",
"host": [
"{{api_endpoint}}"
]
},
"description": "Generated from cURL: curl -X 'POST' \\r\n 'https://{{api_endpoint}}/v1/fax/send' \\r\n -H 'accept: application/json' \\r\n -H 'XM-Token-Authorization: {{your_authorization_token}}' \\r\n -H 'Content-Type: multipart/form-data' \\r\n -F 'attachment=@demo-1-ot.PDF;type=application/pdf' \\r\n -F 'metadata={\r\n "faxOptions": {},\r\n "userId": "{{app_user_id}}",\r\n "subject": "Send fax minimal",\r\n "recipients": [\r\n {\r\n "number": "555-1234",\r\n "name": "John"\r\n }\r\n ],\r\n "comment": "This is a sample comment"\r\n};type=application/json'\r\n"
},
"response": []
}
],
"variable": [
{
"key": "api_endpoint",
"value": "faxus1.xmedius.com/faxservice/rest/v1/fax/send",
"type": "default"
}
]
}
This is the resulting error:
{ "message": "IDL:interstarinc.com/Xm/Directories/DirectoryError:1.0", "errorCode": 0, "detail": "", "time": "2025-04-23T21:10:36.374Z"}