Make a link that opens the online booking page
https://api.app2email.com/v1/{number}/bookings/links Scope: bookings:manage. Not with a sandbox key. A link for a customer to book, move an appointment (purpose reschedule + booking_id) or manage their appointments (purpose manage). Send the url to the customer yourself. With a contact the page knows the customer and confirms the booking right away; without one it is a one-off link and the customer confirms on WhatsApp. The online booking page must be switched on, else the answer says the link will not open yet. created_by is "API key <name>", source "api". Send an Idempotency-Key header to retry safely: the same key and body within 24 hours gets the first answer again (an error does not use the key up).
Path
-
Your app2email WhatsApp number - the number the message is sent FROM. Full number with country code, digits only.
e.g.4976659348270
Headers
-
A unique value for this message or list (eg a UUID). The same request with the same key within 24 hours gets the first answer again, and nothing is sent twice. Ignored by dry runs.
e.g.order-1234-shipped
Body application/json required
- contact string
The customer's WhatsApp number with country code, digits only, or their business-scoped user id.
e.g.61412345678 - name stringe.g.
John - service_id string
Preselect a service.
e.g.haircut - provider_id string
Preselect a staff member.
e.g.maria -
bookreschedulemanage - booking_id string
The appointment (id or reference) of a reschedule / manage link.
e.g.BK-7Q3M2A -
The link stops working after one booking.
-
Default: the business's setting (7 days).
Responses
Fields
- success boolean
- request_id string
- link object
A link that opens the online booking page. Send the url to the customer.
21 fields
- id integer
- code stringe.g.
k3XbQ9rTzP2m - url stringe.g.
https://www.app2email.com/book/k3XbQ9rTzP2m - kind string
This API makes and lists personal links.
personalpublicfeed - contact string | null
Who the link is for. null: a one-off link the customer confirms on WhatsApp.
- contact_name string | null
- service_id string | null
- provider_id string | null
- purpose string
bookreschedulemanage - booking_id integer | null
The appointment of a reschedule / manage link.
- single_use boolean
- max_uses integer
0 = no limit.
- uses integer
- expires string (date-time) | null
- revoked string (date-time) | null
- source stringe.g.
api - created_by stringe.g.
API key Planner - open_count integer
- last_opened string (date-time) | null
- created string (date-time)
- state string
ok: it opens. off: the online booking page is switched off.
oknot_foundexpiredrevokedused_upoff
- note string
Errors
- 400 The request is malformed (missing or invalid fields, query parameters or times).
- 401 Missing, invalid, revoked or expired API key.
- 403 The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account.
- 404 The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found.
- 415 The body is not JSON.
- 422 The request is understood but cannot be sent (template parameters, media, text, recipient, or a WhatsApp rule such as the 24 hour window).
- 429 A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait.
- 500 Unexpected error on app2email's side.