• Instructions to Ask a Question

    Click on the "Ask a Question" button and select the application for which you would like to ask questions.

    We have 5 different products namely - Pabbly Connect, Pabbly Subscription Billing, Pabbly Email Marketing, Pabbly Form Builder, Pabbly Email Verification.

    The turnaround time is 24 hrs (Business Hours - 10.00 AM to 6.00 PM IST, Except Saturday and Sunday). So your kind patience will be highly appreciated!

    🚀🚀Exclusive Discount Offer

    Just in case you're looking for any ongoing offers on Pabbly, you can check the one-time offers listed below. You just need to pay once and use the application forever -
     

    🔥 Pabbly Connect One Time Plan for $249 (🏆Lifetime Access) -  View offer 

    🔥 Pabbly Subscription Billing One Time Plan for $249 (🏆Lifetime Access) - View offer

  • Important: Any reported problems and issues with your integration will be reported to you and we will encourage the app developers help to resolve those integration issues.

How to create an action to upload a file (Binary Upload)

Status
Not open for further replies.

API to Upload File (Binary Upload) Documentation

This document provides an overview of the API to upload file, explaining its purpose, the functionality of each section, and how to use it to send HTTP requests.

Purpose of the API​

This API is designed to:
  1. Act as a middleware service, processing incoming requests.
  2. Validate requests using an API key.
  3. Retrieve a file from a specified URL and forward it, along with other data, to a designated endpoint.
This API helps secure the data transfer by validating incoming requests and facilitating the controlled forwarding of headers and files.

Step1: Configure the HTTP Request in Pabbly

  • Navigate to the Pabbly Connect Developer platform and go to the "Actions" section to set up the action.
  • Method: Set the method as POST.
  • URL: Enter the URL "https://binary-fileupload.pabbly.workers.dev/ " in the "API Endpoint URL" section.
  • Headers:
    • Add a header pabbly_api_key with the value set to our API key.
    • Set Content-Type to application/json.
  • Body: Use JSON format to include the required parameters.

Step 2: Enter the JSON body.

{
"endpoint": "https://upload.heygen.com/v1/asset",
"file_url": "{{file_url}}",
"headers_to_forward": ["x-api-key"],
"method": "POST"
}

JSON Body Parameters:

endpoint: It is the API endpoint of the application you want to configure.

file_url: It is the file URL entered by the user.

Headers_to_forward: Enter the array of headers or a single string comma-separated headers in a single string.
E.g. "headers_to_forward": ["Header1", "Header2", "Header3"] or
"headers_to_forward": "Header1, Header2, Header3".

method: The HTTP method to use when forwarding the file (POST, PUT, etc.).

content_type: You can provide the content type if it is fixed for the entire endpoint. If it is not fixed then do not include it in the JSON Body as the worker code will fetch it automatically from the file_url.

Sample cURL:
Code:
curl -X POST "https://binary-fileupload.pabbly.workers.dev/" \
-H "pabbly_api_key: {{pabbly_api_key}}" \
-H "Authorization: Bearer your_auth_token" \
-H "Content-Type: application/json" \
-d '{
"endpoint": "https://app.recut.in/api/files/upload/filename.png",
"file_url": "https://www.pabbly.com/wp-content/uploads/2023/01/Pabbly.png",
"headers_to_forward": ["Authorization"],
"method": "POST",
"content_type": "application/json"
}'




image (33).png


file_url parameter conditions:
ParameterTypeDescriptionExample Value
pabbly_api_keyHeaderAn authentication key is needed to validate worker access. It should match the predefined key set in the worker code.

pabbly_api_key: {{PabblyPrivateKeyForInternalUse}}

NOTE: This key is only used for our internal development for now.
AuthorizationHeaderCustom header to forward to the target endpoint for further authentication, if required.
Authorization: {{Bearertokenofapplication}}

Content-Type
HeaderDefines the content type of the data being uploaded, such as application/json.Content-Type: application/json
endpointJSON Field
Specifies the destination endpoint where the file should be uploaded. Accepts the file path with placeholders for the file name.
"https://target-endpoint.com/api/files/upload/:filename.jpeg"
file_urlJSON Field
URL of the file to be fetched and uploaded to the destination endpoint. The file is downloaded by the worker before being forwarded.
headers_to_forward

JSON Field

An array of headers to be forwarded from the initial request to the destination endpoint. Useful for passing tokens or other sensitive information.

["Authorization"]
method
JSON Field

Specifies the HTTP method for the request to the destination endpoint. Accepted values are POST, PUT, etc.
"POST"



NOTE:
In the case of Canva. The filename is to be passed as Base64. To do so, we can either take the name as encoded base64 from the user or we can create the same with the help of Select Transform and Multistep action as shown below:


AD_4nXcA8pQoQI1mGyDThlCiqe8Ufu15DTqLpcBmTSPvpQVv5sGyisAzXws7aKI0oeRGVPlmIDgzEZiaTgt-LkPbhC_n0Lf5Qc1wei4DlIWjhw2FmbaaoWKaNDWxup0jq-wDHsqHywJ3Vm47dCcsX5ZGGjIHmn95



Here, the Base64 converted filename is passed as from the action event.


AD_4nXcl9QoM4ML58lrzegn3XEmWQRdBM-FryDg-xS9nBS6buCn8JzUlGbPX22xaaj4pd6xL-g4lxZfXhJwla97Z9zJZu4badcXb-fV9J_Eexwqcph-fswb_TkeHsiezSIyu94_u1tiorlawlFxSG-5Xy4q53ZQ
 
Last edited:
Status
Not open for further replies.
Top