• 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.

Cloudflare Worker Code Explanation and Usage Guide​

This document provides an overview of the Cloudflare Worker code, explaining its purpose, the functionality of each section, and how to use it to send HTTP requests.

Purpose of the Code​

This Cloudflare Worker script 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 script 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 to POST (since the Worker expects a POST request).
  • URL: Enter the URL of the Cloudflare Worker. "https://binary-fileupload.pabbly.workers.dev/ "
  • 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.



AD_4nXcB84eY_XmYwfo_CRCA9_MiOhn7BtjuLFx5ZYT74TXVZw_9wMeS1jgFnhIStomoUGYyDfrbs2OhA5qgUoP1JDsQPfcDzTEvyXgd5JNg3SJ3vAz_PpZdlZ0AE4D4nGjRoCbY78dGYzjATqXU5Dvf9jXdYDZY


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: 3be0fa73-bd3b-4953-a5f7-3ebdfae0feea

AuthorizationHeaderCustom header to forward to the target endpoint for further authentication, if required.
Authorization: Bearer 0fe5962c3da5d434c55f

Content-Type

HeaderDefines the content type of the data being uploaded, such as application/json.
Content-Type: application/json

endpoint
JSON Field

Specifies the destination endpoint where the file should be uploaded. Accepts the file path with placeholders for the file name.


file_url

JSON 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"





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