GetQtaSmsClient.
Link: “https://joinapiweb.jointechnology.it/api/SendSmsApi_v_001/”
Metodo: “GetQtaSmsClient”
Create an array for sending parameters:
string[] parametri = new string[] { "ID_ANAGRAFICA_GEN:" + id.ToString()};
Parameters to pass as Header:
(Example in C#)
public async Task
GetSmsDisponibiliAsync(int id, string token)
{
string[] parametri = new string[] { "ID_ANAGRAFICA_GEN:" + id.ToString()};
var newApi = ApiWeb + "SendSmsApi_v_001/GetQtaSmsClient";
string result;
using HttpClient client = new();
client.BaseAddress = new Uri(newApi);
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
client.DefaultRequestHeaders.Add("Parametri", parametri);
HttpResponseMessage response = await client.GetAsync(newApi);
string data11 = await response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
string data = await response.Content.ReadAsStringAsync();
result = Newtonsoft.Json.JsonConvert.DeserializeObject(data).ToString();
}
else
{
result = "";
}
return result;
}
Json returned from the call:
{
"dati":[
{
"ID_SMSDISPONIBILI":"0",
"ID_ANAGRAFICA_GEN":"0",
"QTASMS":"0",
"ErrCode":"0",
"ErrDesc":"OK"
}
]
}
QTASMS is valued with the SMS still available.
ErrDesc is evaluated with "OK" for success, with the description of the error with failure.