Upload Template Media

Use this API to upload your sample media and generate a handleId for it

Using the handleId, you can create and submit a template along with a sample media. The handleId is passed in the exampleMedia parameter of the Apply for templates with sample media API.

Parameters

KeyDescriptionRequired/OptionalTypeValue
AuthorizationAccess Token for the applicationRequiredString{{PARTNER_APP_TOKEN}}
appIdUnique identifier of the app.RequiredString{{APP_ID}}
fileUpload a file from your local machine or add the public URL to the media.RequiredFile path{{FILE_PATH}}
file typeUpload a file from your local machine.RequiredString{{FILE_TYPE}}

Sample Request

curl --location --request POST 'https://partner.gupshup.io/partner/app/{{APP_ID}}/upload/media' \
--header 'Authorization: {{PARTNER_APP_TOKEN}}' \
--form 'file_type="{{FILE_TYPE}}"' \
--form 'file=@"{{FILE_PATH}}'

OR

curl --location --request POST 'https://partner.gupshup.io/partner/app/{{APP_ID}}/upload/media' \
--header 'Authorization: {{PARTNER_APP_TOKEN}}' \
--form 'file_type="{{FILE_TYPE}}"' \
--form 'file="{{MEDIA_URL}}'

Sample Response

   {
        "handleId": {
        "message": "4::aW1h*****G5n:ARYY-6d3******0RG7nG1d-Rie7-q4*****M_Fcffdkv7glkYgGa0IxKLc9DqlyuVIQD18KxYmgaEfuiUuQSdbYMpjce0jPgI5*****5e5Q:e:1634970144:2******925530161:100033****35566:A*****lB5Nu6A5KJaI"
        },
        "status": "success"
   }
Language
Click Try It! to start a request and see the response here!