Dropshare User Guide

Search for answers to your questions by entering keywords below, or look through our knowledge base.

Contact Support | Community | Video Tutorials

How to set up a Custom API connection

Dropshare 5.58 and newer

Dropshare supports uploading to any custom API that accepts file uploads and responds with a URL to the uploaded file.

To set up an upload connection using a Custom API, select "Custom API" under "Custom Services" when creating a new connection in the Connection preferences.

Set up the credentials as follows:

 

Request  
Upload URL URL to the upload API, must include scheme (http:// or https://)
Method POST or PUT, depending on the Upload API
Content-Type Currently, multipart/form-data is supported
Form Field Name of the form field which will contain the file, for multipart/form-data requests.
Header

Key-Value definition of request header. See "Request Placeholders" for options.

Example:

{
  "Authorization": "YOUR_API_KEY"
}   
Body

Key-Value definition of request body. See "Request Placeholders" for options.

Example:

{
  "filename": "%filename%",
  "secure_url": true
}
Response  
URL to file URL to the uploaded file. See "Response Placeholders" for options.
Content Type Content type of response, can be JSON or Plain Text. When using Plain Text, use %raw% for the URL to file.

Delete URL

(only when Content-Type is JSON)

URL to call when the file should be deleted. Can be an API URL (select Method in "Delete Method"), or a website to be opened (select "Browser"). See "Response Placeholders" for options.

 

Request Placeholders

The following placeholders can be used for the request header or request body fields:

%filename% Original name of the uploaded file

 

Response Placeholders

The following placeholders can be used for the URL to file:

%raw% Full plain text response from Upload API, e.g. if the API responds with just the URL to the uploaded file.

 

When using JSON as content type for the response, all JSON object properties can be used as placeholders for the URL to file.

 

Example JSON 1

{
  "file": {
    "url": "http://server.com/uploads/file.png"
  }
}

Use then %file.url% as URL to file.

 

Example JSON 2

[
  {
    "url": "http://server.com/uploads/file.png"
  }
]

Use then %[0].url% as URL to file.

 

Example JSON 3

{
  "files": [
    "http://server.com/uploads/file.png"
  ]
}

Use then %files[0]% as URL to file.

Last updated:

Was this article helpful?
1 out of 1 found this helpful

If the article was not helpful, please tell us how we can improve! 🙏