Get an API Key
Learn how to generate API keys to create authenticated requests to the Mobile Text Alerts API.
Generate an API Key
Bearer Token Authentication
Example request to verify the API Key
curl -L \
-H 'Authorization: Bearer 89fa747a-e01b-5940-99c2-4e96fa996258' \
'https://api.mobile-text-alerts.com/v3/auth/verify-api-key'// Run with: node --env-file=.env verify.js
async function main() {
const apiKey = process.env.MTA_API_KEY;
const response = await fetch(
"https://api.mobile-text-alerts.com/v3/auth/verify-api-key",
{
method: "GET",
headers: {
"Authorization": `Bearer ${apiKey}`,
"Accept": "*/*",
},
}
);
console.log("STATUS:", response.status);
console.log("CONTENT-TYPE:", response.headers.get("Content-Type"));
const contentType = response.headers.get("Content-Type");
if (contentType && contentType.includes("application/json")) {
const data = await response.json();
console.log(data);
} else {
const text = await response.text();
console.log(text);
}
}
main().catch((err) => {
console.error("Request failed:", err);
process.exitCode = 1;
});Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Responses
200
Success
application/json
400
BadRequestError
application/json
401
UnauthorizedError
application/json
403
ForbiddenError
application/json
500
InternalServerError
application/json
get
/auth/verify-api-keyLast updated
Was this helpful?