HostMentor Docs

Upload the file

POST/upload:{upload_session_id}

Step 2 of uploading a template sample. Send the file's raw bytes (not form data) to the session from step 1.

The session id from step 1 looks like upload:MTph…?sig=ARb…. Append it to the base URL exactly as returned: the part after upload: and before ? is upload_session_id, and sig is the query parameter.

You get back the handle h. Use it in example.header_handle when you create the template.

Authorization

apiKey
apikey<token>

Your HostMentor API key, from the dashboard under Messaging → WhatsApp → API keys.

In: header

Path Parameters

upload_session_id*string

The session ID from step 1, without the upload: prefix and without ?sig=….

Query Parameters

sig*string

The sig value from the end of the session ID.

Request Body

application/octet-stream

body*file
Formatbinary

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://wa.hostmentor.com/v3/upload:MTphdHRhY2htZW50OjNlYTE1ZTkzLTZkZDktNGIwOS1iOTM3LWM4YWZmMTRkYTZkMz9maWxlX2xlbmd0aD0xNjQzMTM?sig=ARbUFIDlNcIbRnOalIY" \  -H "apikey: YOUR_API_KEY" \  -H "Content-Type: application/octet-stream" \  -d 'string'
{  "h": "4::aW1hZ2UvanBlZw==:ARZsON6K-8ukPIq2h95wJ9UUCr439vX2odOWPJ0TjPBISD0:e:1790592000:1849455295211775:100061459561823:ARY_I5AUJyyOhp-Yzdw"}