24
Views
4
Comments
404 Error with PDF.co API in OutSystems (working correctly in Postman)

Hello everyone,

I am trying to integrate the PDF.co API with OutSystems to upload a PDF file, but I am receiving a "404 Not Found" error when calling the API endpoint from OutSystems. The same flow works correctly in Postman.

Configuration Details:

  • API Endpoint: /v1/file/upload
  • HTTP Method: POST
  • Request Format: Multipart/form-data
  • Headers:
    • x-api-key: [My API Key]
    • Content-Type: multipart/form-data

Process Used:

  1. I am using the MultipartFormDataCreate component in OutSystems to prepare the PDF file:

    • Parameters set:
      • name
      • filename
      • ContentType: "multipart/form-data"
      • contentBinary: Resources.speciale56_2023_pdf.Content
    • Encoding: utf-8
  2. After obtaining the binary content of the file, I pass it to the REST API call with the following parameters:

    • Content: MultipartFormDataCreate1.MessageBinary
    • Content-Type: MultipartFormDataCreate1.ContentType

Issue Encountered:

Even though the flow works in Postman, I am getting a "404 Not Found" error from OutSystems. I have verified that the URL, parameters, and headers are configured correctly.

Question:

Is there any configuration difference between Postman and OutSystems that might be causing this error? Has anyone encountered a similar issue or have suggestions on how to resolve it?

Thank you in advance for your help!

Best regards,Binod Comini
Link OML: 

API_Multipartformdata.oml
2020-07-21 19-28-50
Rajat Agrawal
Champion

Hi @Binod Comini,

May be this error occur because you don't pass xapikey value in your code.

Can you please check with passing this value, or you can share I will try and pass.


Regards,

Rajat

UserImage.jpg
Binod Comini

Hi Rajat,

Thank you for your response. In fact, I removed the xapikey value before creating the OML, so it's not an oversight.

Thanks again for your assistance!

Best regards,

Binod Comini

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Binod,

Be aware that Postman runs on your local computer, while OutSystems runs in the cloud. Therefore it could be that the cloud computer can't reach or resolve the address you specify, even if your local computer can. Alternatively, it could also be the case that you have misconfigured the address in OutSystems.

So the first steps to take, is checking in Service Center:

  1. The effective URL of the API you are calling, and;
  2. Check the Integration Logging to see what full URL is used. Increase the logging level of the API if necessary.
UserImage.jpg
Binod Comini

Hi Kilian,

Thank you for your suggestion. I have confirmed that the API endpoint URL is correct, so the issue is not with the address itself. However, I will follow your advice and check Service Center  to review more details, such as the integration logs and the full URL being used. I'll also increase the logging level to gain more insights into the problem.

I'll keep you updated.

Thanks again!  

Best regards,  

Binod

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.