/_bridge/contacts#Whether the app has contacts access, without prompting.
IContactsBridge.GetAccessAsyncTSContactsBridge.getAccess- Response
- 200 ContactsAccessResult
ContactsAccessResult · 1 field
accessAccessState
Nothing matches that. Try a shorter word, or browse the topics.
The contacts bridge searches, reads, creates, updates and deletes the device’s contacts, backed by Shiny.Contacts.
dotnet add package Shiny.AppDeviceBridge.Contactsbuilder.UseAppDeviceBridge( bridge => bridge.AddContactsBridge(), webApp => { /* … */ });| Client | C# | TypeScript |
|---|---|---|
IContactsBridge |
AddContactsBridgeClient() |
ContactsBridge |
| Topic | Details |
|---|---|
| Platforms | Android and iOS. Shiny.Contacts has no Mac Catalyst, macOS, Windows or Linux backend, so there every endpoint returns 501. |
| Listing | GET contacts/items?search=&offset=&limit= returns one page (50 by default, 500 at most) and hasMore. search matches names, phone numbers and emails. |
| Photos | photos never go in the JSON. hasPhoto says whether one exists, and GET contacts/items/{id}/photo?size=full|thumbnail returns the image bytes. |
| Writing | PUT changes only the properties you send. An empty list clears one. |
| iOS | reading note and relationships needs the com.apple.developer.contacts.notes entitlement. Without it they come back empty. |
Every route answers 403 access_denied until access has been granted.
import { ContactsBridge } from "@shinyorg/appdevicebridge";
const contacts = new ContactsBridge();await contacts.requestAccess();
const page = await contacts.getContacts({ search: "smith", limit: 25 });for (const c of page.items) console.log(c.id, c.givenName, c.familyName);
const photo = await contacts.getPhoto(page.items[0].id, { size: "Thumbnail" });img.src = URL.createObjectURL(photo);
const { id } = await contacts.createContact({ givenName: "Ada", familyName: "Lovelace", emails: [{ address: "ada@example.com", type: "Work", label: null }]});/_bridge/contacts#Whether the app has contacts access, without prompting.
IContactsBridge.GetAccessAsyncTSContactsBridge.getAccessaccess | AccessState |
/_bridge/contacts/access#Prompts for contacts access if it has not been decided.
IContactsBridge.RequestAccessAsyncTSContactsBridge.requestAccessaccess | AccessState |
/_bridge/contacts/items#A page of contacts ordered by family then given name, optionally matching a name, phone or email.
IContactsBridge.GetContactsAsyncTSContactsBridge.getContacts| Parameter | In | Type | |
|---|---|---|---|
search | query | string | null | optional |
offset | query | number | optional |
limit | query | number | optional |
items | Contact[] | |
offset | number | |
limit | number | |
hasMore | boolean | Whether another page follows. |
/_bridge/contacts/items#Creates a contact. It needs a given name, family name or company.
IContactsBridge.CreateContactAsyncTSContactsBridge.createContactapplication/json · ContactInputnamePrefix | string | null | |
givenName | string | null | |
middleName | string | null | |
familyName | string | null | |
nameSuffix | string | null | |
nickname | string | null | |
note | string | null | |
organization | ContactOrganization | null | |
phones | ContactPhone[] | null | |
emails | ContactEmail[] | null | |
addresses | ContactAddress[] | null | |
dates | ContactDate[] | null | |
relationships | ContactRelationship[] | null | |
websites | ContactWebsite[] | null |
id | string |
/_bridge/contacts/items/{id}#One contact. Fails with 404 when there is no such contact.
IContactsBridge.GetContactAsyncTSContactsBridge.getContact| Parameter | In | Type | |
|---|---|---|---|
id | path | string | required |
id | string | null | |
displayName | string | |
namePrefix | string | null | |
givenName | string | null | |
middleName | string | null | |
familyName | string | null | |
nameSuffix | string | null | |
nickname | string | null | |
note | string | null | |
organization | ContactOrganization | null | |
phones | ContactPhone[] | |
emails | ContactEmail[] | |
addresses | ContactAddress[] | |
dates | ContactDate[] | |
relationships | ContactRelationship[] | |
websites | ContactWebsite[] | |
hasPhoto | boolean | Whether getPhoto has anything to return. |
/_bridge/contacts/items/{id}#Changes the properties set in changes and leaves the rest as they are.
IContactsBridge.UpdateContactAsyncTSContactsBridge.updateContact| Parameter | In | Type | |
|---|---|---|---|
id | path | string | required |
application/json · ContactInputnamePrefix | string | null | |
givenName | string | null | |
middleName | string | null | |
familyName | string | null | |
nameSuffix | string | null | |
nickname | string | null | |
note | string | null | |
organization | ContactOrganization | null | |
phones | ContactPhone[] | null | |
emails | ContactEmail[] | null | |
addresses | ContactAddress[] | null | |
dates | ContactDate[] | null | |
relationships | ContactRelationship[] | null | |
websites | ContactWebsite[] | null |
id | string | null | |
displayName | string | |
namePrefix | string | null | |
givenName | string | null | |
middleName | string | null | |
familyName | string | null | |
nameSuffix | string | null | |
nickname | string | null | |
note | string | null | |
organization | ContactOrganization | null | |
phones | ContactPhone[] | |
emails | ContactEmail[] | |
addresses | ContactAddress[] | |
dates | ContactDate[] | |
relationships | ContactRelationship[] | |
websites | ContactWebsite[] | |
hasPhoto | boolean | Whether getPhoto has anything to return. |
/_bridge/contacts/items/{id}#Deletes a contact.
IContactsBridge.DeleteContactAsyncTSContactsBridge.deleteContact| Parameter | In | Type | |
|---|---|---|---|
id | path | string | required |
/_bridge/contacts/items/{id}/photo#The contact's photo as encoded image bytes. Fails with 404 when it has none.
IContactsBridge.GetPhotoAsyncTSContactsBridge.getPhoto| Parameter | In | Type | |
|---|---|---|---|
id | path | string | required |
size | query | ContactPhotoSize | optional |
This bridge raises no events — everything it does is a request and its response.
JSON property names are camelCase and enums travel as their names. A ? marks a property the payload may omit;| null one that may be null.
ContactsAccessResultobject#access | AccessState |
AccessStateenum#Where a permission stands. Reported by every bridge that needs one; the names match Shiny's own.
"Unknown""NotSupported""NotSetup""Disabled""Restricted""Denied""Available"ContactPageobject#A page of contacts.
items | Contact[] | |
offset | number | |
limit | number | |
hasMore | boolean | Whether another page follows. |
Contactobject#A contact. Photos are not included; getPhoto fetches them.
id | string | null | |
displayName | string | |
namePrefix | string | null | |
givenName | string | null | |
middleName | string | null | |
familyName | string | null | |
nameSuffix | string | null | |
nickname | string | null | |
note | string | null | |
organization | ContactOrganization | null | |
phones | ContactPhone[] | |
emails | ContactEmail[] | |
addresses | ContactAddress[] | |
dates | ContactDate[] | |
relationships | ContactRelationship[] | |
websites | ContactWebsite[] | |
hasPhoto | boolean | Whether getPhoto has anything to return. |
ContactOrganizationobject#company | string | null | |
title | string | null | |
department | string | null |
ContactPhoneobject#number | string | |
type | PhoneType | |
label | string | null | The label shown on the device, for a Custom type. |
PhoneTypeenum#"Home""Mobile""Work""FaxWork""FaxHome""Pager""Other""Custom"ContactEmailobject#address | string | |
type | EmailType | |
label | string | null | The label shown on the device, for a Custom type. |
EmailTypeenum#"Home""Work""Other""Custom"ContactAddressobject#street | string | null | |
city | string | null | |
state | string | null | |
postalCode | string | null | |
country | string | null | |
type | AddressType | |
label | string | null | The label shown on the device, for a Custom type. |
AddressTypeenum#"Home""Work""Other""Custom"ContactDateobject#date | string | |
type | ContactDateType | |
label | string | null | The label shown on the device, for a Custom type. |
ContactDateTypeenum#"Birthday""Anniversary""Other""Custom"ContactRelationshipobject#name | string | The related person's name. |
type | RelationshipType | |
label | string | null | The label shown on the device, for a Custom type. |
RelationshipTypeenum#"Father""Mother""Parent""Brother""Sister""Child""Friend""Spouse""Partner""Assistant""Manager""Other""Custom"ContactWebsiteobject#url | string | |
label | string | null |
ContactInputobject#A contact to create, or the changes to one. A property left null is left as it is; an empty list clears. Names and organization fields are at most 1,000 characters, the note 10,000, and each list 50 entries.
namePrefix? | string | null | |
givenName? | string | null | |
middleName? | string | null | |
familyName? | string | null | |
nameSuffix? | string | null | |
nickname? | string | null | |
note? | string | null | |
organization? | ContactOrganization | null | |
phones? | ContactPhone[] | null | |
emails? | ContactEmail[] | null | |
addresses? | ContactAddress[] | null | |
dates? | ContactDate[] | null | |
relationships? | ContactRelationship[] | null | |
websites? | ContactWebsite[] | null |
ContactCreatedobject#id | string |
ContactPhotoSizeenum#Which photo to fetch. Each falls back to the other when the contact only has one.
"Full""Thumbnail"These routes sit under AppDeviceBridgePolicies.Bridges like every other bridge: callers on this device by default.
See Security.