|
|
@ -49,7 +49,15 @@ class Octopush extends NotificationProvider {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
params: data
|
|
|
|
params: data
|
|
|
|
};
|
|
|
|
};
|
|
|
|
await axios.post("https://www.octopush-dm.com/api/sms/json", {}, config);
|
|
|
|
|
|
|
|
|
|
|
|
// V1 API returns 200 even on error so we must check
|
|
|
|
|
|
|
|
// response data
|
|
|
|
|
|
|
|
let response = await axios.post("https://www.octopush-dm.com/api/sms/json", {}, config);
|
|
|
|
|
|
|
|
if ("error_code" in response.data) {
|
|
|
|
|
|
|
|
if (response.data.error_code !== "000") {
|
|
|
|
|
|
|
|
this.throwGeneralAxiosError(`Octopush error ${JSON.stringify(response.data)}`);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
throw new Error("Unknown Octopush version!");
|
|
|
|
throw new Error("Unknown Octopush version!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|