RESTful API of Notifications Bounded Context
Headers
As this API is working with JSON every request must add the following headers:
Accept: application/json
And for requests with body:
Content-Type: application/json
Aircall ¶
The aircall documentation about all webhooks available are in here.
Aircall webhoook ¶
Create aircall event in RabbitMQPOST/aircall/webhoook
Example URI
POST https://notifications.spotahome.com/aircall/webhoook
Request
Headers
Content-Type: application/jsonBody
{
"event": "aircall.ended",
"timestamp": 1681826116,
"data": {}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"event": {
"type": "string"
},
"timestamp": {
"type": "number"
},
"data": {
"type": "object",
"properties": {}
}
},
"required": [
"event",
"timestamp",
"data"
]
}Response
204Headers
Content-Type: application/jsonResponse
401Headers
Content-Type: application/jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}Twilio webhook ¶
Create twilio event in RabbitMQPOST/twilio/webhook
Example URI
POST https://notifications.spotahome.com/twilio/webhook
Request
Headers
Content-Type: application/jsonBody
{
"from": "+34666666666",
"to": "+34666666666",
"message": "Hello world!",
"secret": "Hello, world!"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"from": {
"type": "string"
},
"to": {
"type": "string"
},
"message": {
"type": "string"
},
"secret": {
"type": "string"
}
},
"required": [
"from",
"to",
"message",
"secret"
]
}Response
204Headers
Content-Type: application/jsonResponse
403Headers
Content-Type: application/jsonBody
{
"detail": "Forbidden access",
"status": 403,
"title": "Forbidden",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}Sendbird webhook ¶
The sendbird documentation about all webhooks available are in here.
Create sendbird event in RabbitMQPOST/sendbird/webhook
Example URI
POST https://notifications.spotahome.com/sendbird/webhook
Request
Headers
Content-Type: application/jsonBody
{
"category": "open_channel:create",
"app_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"category": {
"type": "string"
},
"app_id": {
"type": "string"
}
},
"required": [
"category",
"app_id"
]
}Response
204Headers
Content-Type: application/jsonResponse
403Headers
Content-Type: application/jsonBody
{
"detail": "Forbidden access",
"status": 403,
"title": "Forbidden",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}Zoho webhook ¶
Create zoho event in RabbitMQPOST/zoho/webhook
Example URI
POST https://notifications.spotahome.com/zoho/webhook
Request
Headers
Content-Type: application/jsonBody
{
"id": "Hello, world!",
"ticketId": "Hello, world!",
"commenterId": "Hello, world!",
"content": "Hello, world!",
"contentType": "Hello, world!",
"isPublic": true,
"attachments": [],
"modifiedTime": "Hello, world!",
"commentedTime": "Hello, world!"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"ticketId": {
"type": "string"
},
"commenterId": {
"type": "string"
},
"content": {
"type": "string"
},
"contentType": {
"type": "string"
},
"isPublic": {
"type": "boolean"
},
"attachments": {},
"modifiedTime": {
"type": "string"
},
"commentedTime": {
"type": "string"
}
},
"required": [
"id",
"ticketId",
"commenterId",
"content",
"contentType",
"isPublic",
"attachments",
"modifiedTime",
"commentedTime"
]
}Response
204Headers
Content-Type: application/jsonResponse
403Headers
Content-Type: application/jsonBody
{
"detail": "Forbidden access",
"status": 403,
"title": "Forbidden",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}Zoho tickets ¶
Create Zoho ticketPOST/api/zoho/tickets
Example URI
POST https://notifications.spotahome.com/api/zoho/tickets
Request
Headers
Content-Type: application/jsonBody
{
"templateName": "booking_follow_up",
"userId": "1d9cae68-d0e3-4d97-b1aa-3bec45099e7f"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"templateName": {
"type": "string"
},
"userId": {
"type": "string"
}
},
"required": [
"templateName",
"userId"
]
}Response
204Headers
Content-Type: application/jsonResponse
400Headers
Content-Type: application/jsonBody
{
"detail": "The request could not be understood by the server due to malformed syntax",
"status": 400,
"title": "Bad Request",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}Response
401Headers
Content-Type: application/jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}Response
403Headers
Content-Type: application/jsonBody
{
"detail": "Forbidden access",
"status": 403,
"title": "Forbidden",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}Response
422Headers
Content-Type: application/jsonBody
{
"detail": "The request was well formed but was unable to be followed due to semantic errors",
"status": 422,
"title": "Unprocessable Entity",
"type": "`http://www.w3.org/Protocols/rfc2616/rfc2616",
"validationMessages": {
"field": {
"stringLength": "The input is less than 6 characters long"
}
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string",
"description": "sec10.html (string, required)"
},
"validationMessages": {
"type": "object",
"properties": {
"field": {
"type": "object",
"properties": {
"stringLength": {
"type": "string"
}
},
"required": [
"stringLength"
]
}
},
"description": "Contains a property for each field that failed validation."
}
},
"required": [
"detail",
"status",
"title"
]
}User contact tickets ¶
Get latest tickets of a userGET/users/me/contacts
Example URI
GET https://notifications.spotahome.com/users/me/contacts
Response
200Headers
Content-Type: application/jsonBody
{
"id": "1d9cae68-d0e3-4d97-b1aa-3bec45099e7f",
"subject": "Booking follow up",
"status": "Open"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"subject": {
"type": "string"
},
"status": {
"type": "string"
}
},
"required": [
"id",
"subject",
"status"
]
}Response
401Headers
Content-Type: application/jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}Response
403Headers
Content-Type: application/jsonBody
{
"detail": "Forbidden access",
"status": 403,
"title": "Forbidden",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}