Skip Navigation

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.
{ "LookupInfo": { "MoreAvailable": true, "TotalCount": 150, "NextPageOffset": 100, "Size": 100, "Offset": 0 }, "Contacts": [ { "DisplayName": "user1_02", "EmailAddress": "user1_02@example.com", "GivenName": "user1", "Surname": "02", "UniqueId" : "AAMkADg2Y2IxMzAwLWJmZmYtAAMkADg2Y..." }, { "DisplayName": "user2_03", "EmailAddress": "user2_03@example.com", "GivenName": "user2", "Surname": "03", "UniqueId" : "AAMkADg2Y2IxMzAwLWJmZmYtNGJjMi1iN..." }, ... ] }
If MoreAvailable is false,
The call to 
BEMS
 to return the next batch of contacts that includes a total of 50 contacts is sent.
{ "LookupInfo": { "MoreAvailable": false, "TotalCount": 150, "NextPageOffset": null, "Size": 50, "Offset": 100 }, "Contacts": [ { "DisplayName": "user55_05", "EmailAddress": "user55@example.com", "GivenName": "user55", "Surname": "05", "UniqueId" : "tNGJjMi1iNAAMkADg2Y2IxMzAwLWJmZmY..." }, { "DisplayName": "user56_06", "EmailAddress": "user56@example.com", "GivenName": "user56", "Surname": "06", "UniqueId" : "AAMkADg2Y2IxMmZmYtNGJjMi1iNzAwLWJ..." }, ... }