Address Book

Base Path: /actor/current/webmail/DIRECT/mailboxes/{mailboxAddress}/addressbook

Version: 3.5.0

Client applications can view their Address Book, create new contacts, update or delete existing contacts and query for contacts that match specific criteria using the Address Book resource collection.

Authorization: OAuth 2.0 Bearer token is required to access the resources of this API. Once signed up, credentials and URL to access the OAuth API can be found on My Apps Page.


Methods

Retrieve address book

GET /actor/current/webmail/DIRECT/mailboxes/{mailboxAddress}/addressbook/

Retrieves the address book of the user.


Parameters

Name

Type

Data Type

Description


Name:

mailboxAddress

required

Type:

path

Data Type:

string

Description:

URL-encoded address of the mailbox.


Sample Value: developer.portal@example.com


Responses


application/json+fhir

200

Successfully retrieved the address book.


application/json+fhir

401

Your API key or access token has expired or is invalid.

Sample Request

curl -X GET "https://api.orionhealth.io/actor/current/webmail/DIRECT/mailboxes/developer.portal@example.com/addressbook/" \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <Access Token>'

Create contact

POST /actor/current/webmail/DIRECT/mailboxes/{mailboxAddress}/addressbook/contact

Creates a new contact in the user's address book.


Parameters

Name

Type

Data Type

Description


Name:

body

required

Type:

body

Data Type:

Description:

Body of the request.

Sample Payload:

{
  "firstName": "test",
  "lastName": "",
  "email": "example.portal@example.com",
  "title": "Mr",
  "organisation": "Orion",
  "specialisation": "Dermatology",
  "contactGroupIds": []
}




Name:

mailboxAddress

required

Type:

path

Data Type:

string

Description:

URL-encoded address of the mailbox.


Sample Value: developer.portal@example.com


Responses


application/json+fhir

200

Successfully created a contact.


application/json+fhir

400

Cannot create the contact, because we detected another contact with the same Direct email address.


application/json+fhir

401

Your API key or access token has expired or is invalid.

Sample Request

curl -X POST "https://api.orionhealth.io/actor/current/webmail/DIRECT/mailboxes/developer.portal@example.com/addressbook/contact" \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <Access Token>' \
-H 'Content-Type: application/json' \
-d '{"firstName":"test","lastName":"","email":"example.portal@example.com","title":"Mr","organisation":"Orion","specialisation":"Dermatology","contactGroupIds":[]}'

Retrieve contact

GET /actor/current/webmail/DIRECT/mailboxes/{mailboxAddress}/addressbook/contact/{contactId}

Retrieves a contact using the contact ID.


Parameters

Name

Type

Data Type

Description


Name:

contactId

required

Type:

path

Data Type:

number

Description:

Unique identifier of the contact.


Sample Value: 12



Name:

mailboxAddress

required

Type:

path

Data Type:

string

Description:

URL-encoded address of the mailbox.


Sample Value: developer.portal@example.com


Responses


application/json+fhir

200

We found contact with that unique identifier.


application/json+fhir

400

Your request was invalid. A parameter, or the data in a parameter, may be incorrect.


application/json+fhir

401

Your API key or access token has expired or is invalid.


application/json+fhir

404

Cannot find a contact with that unique identifier.

Sample Request

curl -X GET "https://api.orionhealth.io/actor/current/webmail/DIRECT/mailboxes/developer.portal@example.com/addressbook/contact/12" \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <Access Token>'

Update contact

POST /actor/current/webmail/DIRECT/mailboxes/{mailboxAddress}/addressbook/contact/{contactId}

Updates the details of an existing contact.


Parameters

Name

Type

Data Type

Description


Name:

contactId

required

Type:

path

Data Type:

number

Description:

Unique identifier of the contact.


Sample Value: 12



Name:

body

required

Type:

body

Data Type:

Description:

Body of the request.

Sample Payload:

{
  "contactId": 2,
  "firstName": "test",
  "lastName": "update",
  "email": "example.portal@example.com",
  "title": "Mr",
  "organisation": "Orion",
  "specialisation": "Dermatology",
  "contactGroupIds": []
}




Name:

mailboxAddress

required

Type:

path

Data Type:

string

Description:

URL-encoded address of the mailbox.


Sample Value: developer.portal@example.com


Responses


application/json+fhir

200

Successfully updated the contact's details.


application/json+fhir

400

Cannot update the contact, because we detected another contact with the same Direct email address.


application/json+fhir

401

Your API key or access token has expired or is invalid.


application/json+fhir

404

Cannot find a contact with that unique identifier.

Sample Request

curl -X POST "https://api.orionhealth.io/actor/current/webmail/DIRECT/mailboxes/developer.portal@example.com/addressbook/contact/12" \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <Access Token>' \
-H 'Content-Type: application/json' \
-d '{"contactId":2,"firstName":"test","lastName":"update","email":"example.portal@example.com","title":"Mr","organisation":"Orion","specialisation":"Dermatology","contactGroupIds":[]}'

Delete contact

DELETE /actor/current/webmail/DIRECT/mailboxes/{mailboxAddress}/addressbook/contact/{contactId}

Deletes a contact from the user's address book.


Parameters

Name

Type

Data Type

Description


Name:

contactId

required

Type:

path

Data Type:

number

Description:

Unique identifier of the contact.


Sample Value: 1



Name:

mailboxAddress

required

Type:

path

Data Type:

string

Description:

URL-encoded address of the mailbox.


Sample Value: developer.portal@example.com


Responses


application/json+fhir

200

Successfully deleted a contact with that unique identifier.


application/json+fhir

401

Your API key or access token has expired or is invalid.


application/json+fhir

404

Cannot find a contact with that unique identifier.

Sample Request

curl -X DELETE "https://api.orionhealth.io/actor/current/webmail/DIRECT/mailboxes/developer.portal@example.com/addressbook/contact/1" \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <Access Token>'

Create contact group

POST /actor/current/webmail/DIRECT/mailboxes/{mailboxAddress}/addressbook/contactgroup

Creates a new contact group in the user's address book.


Parameters

Name

Type

Data Type

Description


Name:

body

required

Type:

body

Data Type:

Description:

Body of the request.

Sample Payload:

{
  "name": "Test Contact Group",
  "description": "Test Contact Group Description",
  "contacts": [
    {
      "contactId": 3,
      "firstName": "User",
      "lastName": "Test",
      "email": "test@example.com",
      "title": "Mr"
    }
  ]
}




Name:

mailboxAddress

required

Type:

path

Data Type:

string

Description:

URL-encoded address of the mailbox.


Sample Value: developer.portal@example.com


Responses


application/json+fhir

200

Successfully created a contact group.


application/json+fhir

400

Your request was invalid. A parameter, or the data in a parameter, may be incorrect.


application/json+fhir

401

Your API key or access token has expired or is invalid.

Sample Request

curl -X POST "https://api.orionhealth.io/actor/current/webmail/DIRECT/mailboxes/developer.portal@example.com/addressbook/contactgroup" \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <Access Token>' \
-H 'Content-Type: application/json' \
-d '{"name":"Test Contact Group","description":"Test Contact Group Description","contacts":[{"contactId":3,"firstName":"User","lastName":"Test","email":"test@example.com","title":"Mr"}]}'

Retrieve contact group

GET /actor/current/webmail/DIRECT/mailboxes/{mailboxAddress}/addressbook/contactgroup/{contactGroupId}

Retrieves a contact group from the user's address book.


Parameters

Name

Type

Data Type

Description


Name:

contactGroupId

required

Type:

path

Data Type:

number

Description:

Unique identifier of the contact group.


Sample Value: 3



Name:

mailboxAddress

required

Type:

path

Data Type:

string

Description:

URL-encoded address of the mailbox.


Sample Value: developer.portal@example.com


Responses


application/json+fhir

200

We found a contact group with that unique identifier.


application/json+fhir

401

Your API key or access token has expired or is invalid.


application/json+fhir

404

Cannot find a contact group with that unique identifier.

Sample Request

curl -X GET "https://api.orionhealth.io/actor/current/webmail/DIRECT/mailboxes/developer.portal@example.com/addressbook/contactgroup/3" \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <Access Token>'

Update contact group

POST /actor/current/webmail/DIRECT/mailboxes/{mailboxAddress}/addressbook/contactgroup/{contactGroupId}

Updates a contact group in the user's address book.


Parameters

Name

Type

Data Type

Description


Name:

contactGroupId

required

Type:

path

Data Type:

number

Description:

Unique identifier of the contact group.


Sample Value: 3



Name:

body

required

Type:

body

Data Type:

Description:

Body of the request.

Sample Payload:

{
  "contactId": 2,
  "name": "Test Contact Group",
  "description": "Test Contact Group Description",
  "contacts": [
    {
      "contactId": 3,
      "firstName": "User",
      "lastName": "Test",
      "email": "test@example.com",
      "title": "Mr"
    }
  ]
}




Name:

mailboxAddress

required

Type:

path

Data Type:

string

Description:

URL-encoded address of the mailbox.


Sample Value: developer.portal@example.com


Responses


application/json+fhir

200

Successfully updated a contact group with that unique identifier.


application/json+fhir

400

Cannot update the contact group, because the name of the contact group or the contact you are trying to add to the group is invalid.


application/json+fhir

401

Your API key or access token has expired or is invalid.


application/json+fhir

404

Cannot find a contact group with that unique identifier.

Sample Request

curl -X POST "https://api.orionhealth.io/actor/current/webmail/DIRECT/mailboxes/developer.portal@example.com/addressbook/contactgroup/3" \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <Access Token>' \
-H 'Content-Type: application/json' \
-d '{"contactId":2,"name":"Test Contact Group","description":"Test Contact Group Description","contacts":[{"contactId":3,"firstName":"User","lastName":"Test","email":"test@example.com","title":"Mr"}]}'

Delete contact group

DELETE /actor/current/webmail/DIRECT/mailboxes/{mailboxAddress}/addressbook/contactgroup/{contactGroupId}

Deletes a contact group in the user's address book.


Parameters

Name

Type

Data Type

Description


Name:

contactGroupId

required

Type:

path

Data Type:

number

Description:

Unique identifier of the contact group.


Sample Value: 3



Name:

mailboxAddress

required

Type:

path

Data Type:

string

Description:

URL-encoded address of the mailbox.


Sample Value: developer.portal@example.com


Responses


application/json+fhir

200

Successfully deleted a contact group with that unique identifier.


application/json+fhir

401

Your API key or access token has expired or is invalid.


application/json+fhir

404

Cannot find a contact group with that unique identifier.

Sample Request

curl -X DELETE "https://api.orionhealth.io/actor/current/webmail/DIRECT/mailboxes/developer.portal@example.com/addressbook/contactgroup/3" \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <Access Token>'