Get the WhatsApp link
const url = 'https://api.emite.cr/v1/auth/me/whatsapp';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.emite.cr/v1/auth/me/whatsapp \ --header 'Authorization: Bearer <token>'Current WhatsApp link status + notification toggles of the signed-in person: { linked: false } without a link; otherwise linked: true, the number (phoneE164), verified (false while its code is pending), tenantId (the company the number acts for: that of the session that linked it) and the toggles (prefs). For a person’s session (JWT) only: an API key answers 403.
Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”The link of the signed-in person, or { linked: false }.
object
Whether the person has a WhatsApp number linked, pending or verified. Without one, this is the only field.
The linked number, in E.164. Present when linked.
true once the code sent over WhatsApp was confirmed; false while it is pending (POST /v1/auth/me/whatsapp/verify). Present when linked.
The company the number acts for: that of the session that linked it. Present when linked.
The notification toggles of the link, all off on a new link (PUT /v1/auth/me/whatsapp/prefs changes them). Present when linked.
object
Notify when Hacienda accepts a document the company issued.
Notify when Hacienda rejects a document the company issued.
Notify when a document ends in error instead of a verdict: sending it or checking its status failed for good, or Hacienda gave no verdict within 24 hours.
Notify when pending purchase acceptances approach their DGT deadline.
Notify when a batch of documents received at the company’s inbound mailbox finishes importing.
Example
{ "phoneE164": "+50688887777"}