Notification contacts

Listing

GET /notification_contacts/

Gets the list of contacts configured for the account.

Status Codes:
  • 200 – 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/cc15a0ea-6009-408e-8d47-0d39ad25fd70/",
            "uuid": "cc15a0ea-6009-408e-8d47-0d39ad25fd70"
        }
    ]
}

Creating

POST /notification_contacts/

Creates a new contact.

Status Codes:
  • 201 – 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": "+1 123 555 1234",
            "resource_uri": "/api/2.0/notification_contacts/569827d6-f7ca-46c3-8b78-52cab30d0e7b/",
            "uuid": "569827d6-f7ca-46c3-8b78-52cab30d0e7b"
        }
    ]
}

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 – no errors

Example request:

PUT /api/2.0/notification_contacts/569827d6-f7ca-46c3-8b78-52cab30d0e7b/ 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": "+1 123 555 1234",
    "pk": "569827d6-f7ca-46c3-8b78-52cab30d0e7b",
    "resource_uri": "/api/2.0/notification_contacts/569827d6-f7ca-46c3-8b78-52cab30d0e7b/",
    "uuid": "569827d6-f7ca-46c3-8b78-52cab30d0e7b"
}

Deleting

DELETE /notification_contacts/{uuid}/

Delete a notification contact. Note that you cannot delete the main contact.

Status Codes:
  • 204 – no errors

Example request:

DELETE /api/2.0/notification_contacts/569827d6-f7ca-46c3-8b78-52cab30d0e7b/ 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 – 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": 23
    },
    "objects": [
        {
            "contact": "/api/2.0/notification_contacts/cc15a0ea-6009-408e-8d47-0d39ad25fd70/",
            "medium": "email",
            "type": "subscription_renewal_soon",
            "value": true
        },
        {
            "contact": "/api/2.0/notification_contacts/cc15a0ea-6009-408e-8d47-0d39ad25fd70/",
            "medium": "email",
            "type": "out_of_money_soon",
            "value": false
        },
        {
            "contact": "/api/2.0/notification_contacts/cc15a0ea-6009-408e-8d47-0d39ad25fd70/",
            "medium": "email",
            "type": "subscription_expire_soon",
            "value": false
        },
        {
            "contact": "/api/2.0/notification_contacts/cc15a0ea-6009-408e-8d47-0d39ad25fd70/",
            "medium": "email",
            "type": "subscription_renewal_success",
            "value": false
        },
        {
            "contact": "/api/2.0/notification_contacts/cc15a0ea-6009-408e-8d47-0d39ad25fd70/",
            "medium": "email",
            "type": "reset_password",
            "value": false
        },
        {
            "contact": "/api/2.0/notification_contacts/cc15a0ea-6009-408e-8d47-0d39ad25fd70/",
            "medium": "email",
            "type": "trial_expire",
            "value": false
        },
        {
            "contact": "/api/2.0/notification_contacts/cc15a0ea-6009-408e-8d47-0d39ad25fd70/",
            "medium": "email",
            "type": "drives_delete_soon",
            "value": false
        },
        {
            "contact": "/api/2.0/notification_contacts/cc15a0ea-6009-408e-8d47-0d39ad25fd70/",
            "medium": "email",
            "type": "subscription_expire",
            "value": true
        },
        {
            "contact": "/api/2.0/notification_contacts/cc15a0ea-6009-408e-8d47-0d39ad25fd70/",
            "medium": "email",
            "type": "new_account",
            "value": true
        },
        {
            "contact": "/api/2.0/notification_contacts/cc15a0ea-6009-408e-8d47-0d39ad25fd70/",
            "medium": "api",
            "type": "payment_withheld",
            "value": true
        },
        {
            "contact": "/api/2.0/notification_contacts/cc15a0ea-6009-408e-8d47-0d39ad25fd70/",
            "medium": "email",
            "type": "random_upgrade",
            "value": false
        },
        {
            "contact": "/api/2.0/notification_contacts/cc15a0ea-6009-408e-8d47-0d39ad25fd70/",
            "medium": "email",
            "type": "subscription_renew_soon",
            "value": true
        },
        {
            "contact": "/api/2.0/notification_contacts/cc15a0ea-6009-408e-8d47-0d39ad25fd70/",
            "medium": "email",
            "type": "drives_delete",
            "value": true
        },
        {
            "contact": "/api/2.0/notification_contacts/cc15a0ea-6009-408e-8d47-0d39ad25fd70/",
            "medium": "email",
            "type": "subscription_renewal_failure",
            "value": true
        },
        {
            "contact": "/api/2.0/notification_contacts/cc15a0ea-6009-408e-8d47-0d39ad25fd70/",
            "medium": "email",
            "type": "stop_servers",
            "value": true
        },
        {
            "contact": "/api/2.0/notification_contacts/cc15a0ea-6009-408e-8d47-0d39ad25fd70/",
            "medium": "api",
            "type": "payment_approved",
            "value": true
        },
        {
            "contact": "/api/2.0/notification_contacts/cc15a0ea-6009-408e-8d47-0d39ad25fd70/",
            "medium": "email",
            "type": "subscription_renewal_very_soon",
            "value": true
        },
        {
            "contact": "/api/2.0/notification_contacts/cc15a0ea-6009-408e-8d47-0d39ad25fd70/",
            "medium": "email",
            "type": "subscription_expire_very_soon",
            "value": true
        },
        {
            "contact": "/api/2.0/notification_contacts/cc15a0ea-6009-408e-8d47-0d39ad25fd70/",
            "medium": "email",
            "type": "payment_failed",
            "value": true
        },
        {
            "contact": "/api/2.0/notification_contacts/cc15a0ea-6009-408e-8d47-0d39ad25fd70/",
            "medium": "email",
            "type": "out_of_money_very_soon",
            "value": true
        },
        {
            "contact": "/api/2.0/notification_contacts/cc15a0ea-6009-408e-8d47-0d39ad25fd70/",
            "medium": "email",
            "type": "payment",
            "value": true
        },
        {
            "contact": "/api/2.0/notification_contacts/cc15a0ea-6009-408e-8d47-0d39ad25fd70/",
            "medium": "api",
            "type": "payment_cancelled",
            "value": true
        },
        {
            "contact": "/api/2.0/notification_contacts/cc15a0ea-6009-408e-8d47-0d39ad25fd70/",
            "medium": "email",
            "type": "trial_expire_soon",
            "value": true
        }
    ]
}

Updating

PUT /notification_preferences/

Updates the specified preferences. Only the ones in the request are modified.

Status Codes:
  • 200 – 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/cc15a0ea-6009-408e-8d47-0d39ad25fd70/",
    "medium": "email",
    "type": "subscription_renewal_soon",
    "value": false
}

Example response:

HTTP/1.1 202 ACCEPTED
Content-Type: application/json; charset=utf-8

{
    "objects": [
        {
            "contact": "/api/2.0/notification_contacts/cc15a0ea-6009-408e-8d47-0d39ad25fd70/",
            "medium": "email",
            "type": "subscription_renewal_soon",
            "value": false
        }
    ]
}

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/cc15a0ea-6009-408e-8d47-0d39ad25fd70/",
        "medium": "email",
        "type": "out_of_money_soon",
        "value": true
    },
    {
        "contact": "/api/2.0/notification_contacts/cc15a0ea-6009-408e-8d47-0d39ad25fd70/",
        "medium": "email",
        "type": "subscription_expire_soon",
        "value": true
    },
    {
        "contact": "/api/2.0/notification_contacts/cc15a0ea-6009-408e-8d47-0d39ad25fd70/",
        "medium": "email",
        "type": "subscription_renewal_success",
        "value": true
    }
]

Example response:

HTTP/1.1 202 ACCEPTED
Content-Type: application/json; charset=utf-8

{
    "objects": [
        {
            "contact": "/api/2.0/notification_contacts/cc15a0ea-6009-408e-8d47-0d39ad25fd70/",
            "medium": "email",
            "type": "out_of_money_soon",
            "value": true
        },
        {
            "contact": "/api/2.0/notification_contacts/cc15a0ea-6009-408e-8d47-0d39ad25fd70/",
            "medium": "email",
            "type": "subscription_expire_soon",
            "value": true
        },
        {
            "contact": "/api/2.0/notification_contacts/cc15a0ea-6009-408e-8d47-0d39ad25fd70/",
            "medium": "email",
            "type": "subscription_renewal_success",
            "value": true
        }
    ]
}