Developer Documentation (API)
Get a list of templates
POST Request
Endpoint URL
https://veski.leikbreytir.is/api/hook/subscribe/{pass-template-uid}
https://veski.leikbreytir.is/api/hook/subscribe/
Purpose
Creates a new subscription which means from this point on you’ll receive notifications to the URL provided until you unsubscribe.
Required input parameters
- HTTP Authorization Header that contains your API key
- (optional) pass-template UID as part of the URL. This is the pass-template you want to receive notifications for. If you omit the pass-template UID the Hook is registered globally
- subscription_url – if a user deletes his Passcreator account we’ll try to notify your server by sending a DELETE request to this URL.
- target_url – this is the URL we will use to push information. The information will always be pushed as JSON payload.
- event – the event key (e.g. pass_created) that you are subscribing for. Please see the definition of the hooks below to get the keys.
Returned values
On success HTTP status 201 (created) is returned otherwhise a appropriate status code that represents the error.
Example output:
{
"subscription_url": "https://yourdomain.com/hooks/standard/your-
individual-hook-id/",
"target_url": "https://yourdomain.com/hooks/standard/your-
individual-hook-id/",
"event": "pass_created"
}
Available Hook Types
- pass_created – a new pass has been created
- pushnotification_registered – a pass has been saved on a phone
- pushnotification_unregistered – a pass has been removed form a phone
- pass_voided – the pass is no longer valid
- pass_template_created – a new pass template has been created
- pass_template_updated – a pass template has been updated
- app_scan_created – a pass has been scanned. Either using the Passcreator Companion app or in a third party system.