//C# - RestSharp
var url = "https://api.smsgatewayapi.com/v1/messagetemplates/";
var payload = new {
ID = {ID},
message = "Hello World"
};
var client = new RestClient(url);
client.Timeout = -1;
var request = new RestRequest(Method.PATCH);
request.AddHeader("X-Client-Id", "XXX"); // Your API key
request.AddHeader("X-Client-Secret", "YYY"); // Your API secret
request.AddHeader("Content-Type", "application/json");
request.RequestFormat = DataFormat.Json;
request.AddJsonBody(payload);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
//PowerShell - RestMethod
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("X-Client-Id", "XXX") // Your API key
$headers.Add("X-Client-Secret", "YYY") // Your API secret
$body = '{
"ID": "{ID}", //Message ID (required)
}'
$response = Invoke-RestMethod 'https://api.smsgatewayapi.com/v1/messagetemplates/' -Method 'PATCH' -Headers $headers -Body $body -ContentType “application/json; charset=utf-8”
$response | ConvertTo-Json
//Shell - wget
wget --no-check-certificate --quiet \
--method PATCH \
--timeout=0 \
--header 'X-Client-Id: XXX' \ // Your API key
--header 'X-Client-Secret: YYY' \ // Your API secret
--header 'Content-Type: application/json' \
--body-data '{
"ID" : "{ID}" //Message ID (required)
}' \
'https://api.smsgatewayapi.com/v1/messagetemplates/'