Notification contacts
Listing
- GET /notification_contacts/
Gets the list of contacts configured for the account.
- Status Codes:
200 OK – no error
Example request:
GET /api/2.0/notification_contacts/?limit=0 HTTP/1.1 Content-Type: application/json Authorization: Basic SWYgeW91IGZvdW5kIHRoaXMsIGhhdmUgYSBjb29raWUsIHlvdSBkZXNlcnZlIGl0IDop
Example response:
HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 { "meta": { "limit": 0, "offset": 0, "total_count": 1 }, "objects": [ { "email": "some_email_1@example.com", "main": true, "name": "Some Name", "phone": "", "resource_uri": "/api/2.0/notification_contacts/e13c4b8c-68c8-4163-bc00-2a43a86e5937/", "uuid": "e13c4b8c-68c8-4163-bc00-2a43a86e5937" } ] }
Creating
- POST /notification_contacts/
Creates a new contact.
- Status Codes:
201 Created – object created
Example request:
POST /api/2.0/notification_contacts/ HTTP/1.1 Content-Type: application/json Authorization: Basic SWYgeW91IGZvdW5kIHRoaXMsIGhhdmUgYSBjb29raWUsIHlvdSBkZXNlcnZlIGl0IDop { "objects": [ { "email": "some_email_2@example.com", "name": "Some Name 2", "phone": "+1 123 555 1234" } ] }
Example response:
HTTP/1.1 201 CREATED Content-Type: application/json; charset=utf-8 { "objects": [ { "email": "some_email_2@example.com", "main": null, "name": "Some Name 2", "phone": "+11235551234", "resource_uri": "/api/2.0/notification_contacts/0103f398-9f85-446a-a285-fe63cf9f0f28/", "uuid": "0103f398-9f85-446a-a285-fe63cf9f0f28" } ] }
Editing
- PUT /notification_contacts/{uuid}/
Edits a notification contact. Note that changing the main user’s email is not recommended, as if the account email changes, so will the main contact.
- Status Codes:
200 OK – no errors
Example request:
PUT /api/2.0/notification_contacts/0103f398-9f85-446a-a285-fe63cf9f0f28/ HTTP/1.1 Content-Type: application/json Authorization: Basic SWYgeW91IGZvdW5kIHRoaXMsIGhhdmUgYSBjb29raWUsIHlvdSBkZXNlcnZlIGl0IDop { "email": "some_email_2@example.com", "name": "Some New Name" }
Example response:
HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 { "email": "some_email_2@example.com", "main": null, "name": "Some New Name", "phone": "+11235551234", "pk": "0103f398-9f85-446a-a285-fe63cf9f0f28", "resource_uri": "/api/2.0/notification_contacts/0103f398-9f85-446a-a285-fe63cf9f0f28/", "uuid": "0103f398-9f85-446a-a285-fe63cf9f0f28" }
Deleting
- DELETE /notification_contacts/{uuid}/
Delete a notification contact. Note that you cannot delete the main contact.
- Status Codes:
204 No Content – no errors
Example request:
DELETE /api/2.0/notification_contacts/0103f398-9f85-446a-a285-fe63cf9f0f28/ HTTP/1.1 Content-Type: application/json Authorization: Basic SWYgeW91IGZvdW5kIHRoaXMsIGhhdmUgYSBjb29raWUsIHlvdSBkZXNlcnZlIGl0IDop
Example response:
HTTP/1.1 204 NO CONTENT Content-Type: text/html; charset=utf-8
Notification preferences
Listing
- GET /notification_preferences/
Gets the list of contacts configured for the account.
- Status Codes:
200 OK – no error
Example request:
GET /api/2.0/notification_preferences/?limit=0 HTTP/1.1 Content-Type: application/json Authorization: Basic SWYgeW91IGZvdW5kIHRoaXMsIGhhdmUgYSBjb29raWUsIHlvdSBkZXNlcnZlIGl0IDop
Example response:
HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 { "meta": { "limit": 0, "offset": 0, "total_count": 22 }, "objects": [ { "contact": "/api/2.0/notification_contacts/e13c4b8c-68c8-4163-bc00-2a43a86e5937/", "medium": "email", "type": "trial_expire", "value": false }, { "contact": "/api/2.0/notification_contacts/e13c4b8c-68c8-4163-bc00-2a43a86e5937/", "medium": "email", "type": "payment_withheld", "value": false }, { "contact": "/api/2.0/notification_contacts/e13c4b8c-68c8-4163-bc00-2a43a86e5937/", "medium": "email", "type": "payment_failed", "value": true }, { "contact": "/api/2.0/notification_contacts/e13c4b8c-68c8-4163-bc00-2a43a86e5937/", "medium": "email", "type": "subscription_renewal_failure", "value": false }, { "contact": "/api/2.0/notification_contacts/e13c4b8c-68c8-4163-bc00-2a43a86e5937/", "medium": "email", "type": "subscription_expire", "value": true }, { "contact": "/api/2.0/notification_contacts/e13c4b8c-68c8-4163-bc00-2a43a86e5937/", "medium": "email", "type": "out_of_money_soon", "value": false }, { "contact": "/api/2.0/notification_contacts/e13c4b8c-68c8-4163-bc00-2a43a86e5937/", "medium": "email", "type": "stop_servers", "value": true }, { "contact": "/api/2.0/notification_contacts/e13c4b8c-68c8-4163-bc00-2a43a86e5937/", "medium": "email", "type": "subscription_renewal_success", "value": false }, { "contact": "/api/2.0/notification_contacts/e13c4b8c-68c8-4163-bc00-2a43a86e5937/", "medium": "email", "type": "subscription_expire_soon", "value": true }, { "contact": "/api/2.0/notification_contacts/e13c4b8c-68c8-4163-bc00-2a43a86e5937/", "medium": "email", "type": "out_of_money_very_soon", "value": false }, { "contact": "/api/2.0/notification_contacts/e13c4b8c-68c8-4163-bc00-2a43a86e5937/", "medium": "email", "type": "payment", "value": true }, { "contact": "/api/2.0/notification_contacts/e13c4b8c-68c8-4163-bc00-2a43a86e5937/", "medium": "email", "type": "drives_delete_soon", "value": true }, { "contact": "/api/2.0/notification_contacts/e13c4b8c-68c8-4163-bc00-2a43a86e5937/", "medium": "email", "type": "subscription_renewal_very_soon", "value": true }, { "contact": "/api/2.0/notification_contacts/e13c4b8c-68c8-4163-bc00-2a43a86e5937/", "medium": "email", "type": "new_account", "value": false }, { "contact": "/api/2.0/notification_contacts/e13c4b8c-68c8-4163-bc00-2a43a86e5937/", "medium": "email", "type": "reset_password", "value": false }, { "contact": "/api/2.0/notification_contacts/e13c4b8c-68c8-4163-bc00-2a43a86e5937/", "medium": "email", "type": "drives_delete", "value": true }, { "contact": "/api/2.0/notification_contacts/e13c4b8c-68c8-4163-bc00-2a43a86e5937/", "medium": "email", "type": "random_upgrade", "value": true }, { "contact": "/api/2.0/notification_contacts/e13c4b8c-68c8-4163-bc00-2a43a86e5937/", "medium": "email", "type": "trial_expire_soon", "value": false }, { "contact": "/api/2.0/notification_contacts/e13c4b8c-68c8-4163-bc00-2a43a86e5937/", "medium": "email", "type": "payment_cancelled", "value": false }, { "contact": "/api/2.0/notification_contacts/e13c4b8c-68c8-4163-bc00-2a43a86e5937/", "medium": "email", "type": "subscription_renewal_soon", "value": false }, { "contact": "/api/2.0/notification_contacts/e13c4b8c-68c8-4163-bc00-2a43a86e5937/", "medium": "email", "type": "subscription_expire_very_soon", "value": false }, { "contact": "/api/2.0/notification_contacts/e13c4b8c-68c8-4163-bc00-2a43a86e5937/", "medium": "email", "type": "payment_approved", "value": true } ] }
Updating
- PUT /notification_preferences/
Updates the specified preferences. Only the ones in the request are modified.
- Status Codes:
200 OK – no error
Example request:
PUT /api/2.0/notification_preferences/ HTTP/1.1 Content-Type: application/json Authorization: Basic SWYgeW91IGZvdW5kIHRoaXMsIGhhdmUgYSBjb29raWUsIHlvdSBkZXNlcnZlIGl0IDop { "contact": "/api/2.0/notification_contacts/e13c4b8c-68c8-4163-bc00-2a43a86e5937/", "medium": "email", "type": "trial_expire", "value": true }
Example response:
HTTP/1.1 202 ACCEPTED Content-Type: application/json; charset=utf-8 { "objects": [ { "contact": "/api/2.0/notification_contacts/e13c4b8c-68c8-4163-bc00-2a43a86e5937/", "medium": "email", "type": "trial_expire", "value": true } ] }
Multiple objects can be specified in the request.
Example request:
PUT /api/2.0/notification_preferences/ HTTP/1.1 Content-Type: application/json Authorization: Basic SWYgeW91IGZvdW5kIHRoaXMsIGhhdmUgYSBjb29raWUsIHlvdSBkZXNlcnZlIGl0IDop [ { "contact": "/api/2.0/notification_contacts/e13c4b8c-68c8-4163-bc00-2a43a86e5937/", "medium": "email", "type": "trial_expire", "value": false }, { "contact": "/api/2.0/notification_contacts/e13c4b8c-68c8-4163-bc00-2a43a86e5937/", "medium": "email", "type": "payment_withheld", "value": true }, { "contact": "/api/2.0/notification_contacts/e13c4b8c-68c8-4163-bc00-2a43a86e5937/", "medium": "email", "type": "payment_failed", "value": false } ]
Example response:
HTTP/1.1 202 ACCEPTED Content-Type: application/json; charset=utf-8 { "objects": [ { "contact": "/api/2.0/notification_contacts/e13c4b8c-68c8-4163-bc00-2a43a86e5937/", "medium": "email", "type": "trial_expire", "value": false }, { "contact": "/api/2.0/notification_contacts/e13c4b8c-68c8-4163-bc00-2a43a86e5937/", "medium": "email", "type": "payment_withheld", "value": true }, { "contact": "/api/2.0/notification_contacts/e13c4b8c-68c8-4163-bc00-2a43a86e5937/", "medium": "email", "type": "payment_failed", "value": false } ] }