Skip to content

Upload Media

Upload Image From Data

Upload Image From Data Payload

Method Type - POST

REQUEST URL - https://messagingapi.charteredinfo.com/v19.0/{{Phone-Number-ID}}/media

Request Headers - Content-Type: application/json
- Authorization: Bearer {{Auth Key}}

1
2
3
4
5
6
7
8
9
    var client = new HttpClient();
    var request = new HttpRequestMessage(HttpMethod.Post, "https://messagingapi.charteredinfo.com/{{Version}}/{{Phone-Number-ID}}/media");
    var content = new MultipartFormDataContent();
    content.Add(new StringContent("whatsapp"), "messaging_product");
    content.Add(new StreamContent(File.OpenRead("/Users/Sample.jpg")), "file", "/Users/Sample.jpg");
    request.Content = content;
    var response = await client.SendAsync(request);
    response.EnsureSuccessStatusCode();
    Console.WriteLine(await response.Content.ReadAsStringAsync());

Upload Image Base64

Upload Image Base64

Method Type - POST

REQUEST URL - https://messagingapi.charteredinfo.com/v19.0/{{Phone-Number-ID}}/Media/UploadB64/media

Request Headers - Content-Type: application/json
- Authorization: Bearer {{Auth Key}}

1
2
3
4
5
{
    "fileName": "string",
    "mimeType": "string",
    "b64OfMedia": "string"
}