Request all contacts
You can retrieve all contacts in a user's contact folder. In the following sample code,
BEMS
retrieves all the contacts for the user, Jamie, excluding any deleted contacts. The first response from BEMS
includes up to 100 contacts, as specified by MaxNumber. Each contact that is retrieved includes the default Basic properties that are specified in BEMS
. If more than 100 contacts are available (for example, this mailbox includes a TotalCount of 150 contacts) the response includes a MoreAvailable is true, so the client application sends additional requests using the NextOffset value to retrieve contacts in batches until MoreAvailable is false. In this example, the Basic properties return the following information for the contacts:
- Display name
- Email address
- Given name
- Surname
POST https://localhost:8443/api/contact HTTP/1.1Content-Type: application/json X-Good-GD-AuthToken: <GDAuthToken> { "Account": "jamie01@ex365.example.com", "MaxNumber": 100, "Offset": 0, "UserShape": ["Basic"] }
If the request is successful,
BEMS
returns the following response batches and the third-party BlackBerry
Dynamics
apps display the following information:
Values |
Sample code |
---|---|
If MoreAvailable is true |
BEMS returns the first batch of 100 contacts.
|
If MoreAvailable is false, |
The call to BEMS to return the next batch of contacts that includes a total of 50 contacts is sent.
|