Contact /contact/{contact-id}

Represents an individual contact.

Reading

GET /contact/{contact-id} HTTP/1.1
Host: localhost:3000

Permissions

  • An access token with workspace_repertory permission is required.
  • If access token points to an user, at least one of the following criteria must be met :
    • The contact is owned by the current person.
    • The contact is shared with the current person.
    • The current person is an admin of the workspace at witch is attached the contact.
  • If access token points to a workspace, at least one of the following criteria must be met :
    • The current workspace is the workspace at witch is attached the contact.

Fields

Name Description Type

_id

The contact ID.

string

first_name

The first name of the contact.

string

last_name

The last name of the contact.

string

type

The type of the contact.

string

job

The job of the contact.

string

account

The ID of the Account of the contact.

Account

avatar

The ID of the Photo that represents the avatar of the contact.

Photo

website_url

The website url of the contact.

string

mails

The mail addresses of the contact.

object[]

type

The type attached to the mail address.

string

address

The mail address.

string

main

If the address is the main mail.

boolean

phones

The phone numbers of the contact.

object[]

type

The type attached to the phone number.

string

number

The phone number.

string

main

If the number is the main phone.

boolean

addresses

The postal addresses of the contact.

object[]

type

The type attached to the postal address.

string

lane_number

The address lane number.

string

lane_name

The address lane name.

string

complement

The address complement.

string

zip

The address zip.

string

city

The address city.

string

region

The address region.

string

country

The address country.

string

main

If the address is the main address.

boolean

notes

Notes about the contact.

string

custom_fields

Custom fields attached to the contact.

object

tags

An array of Tag IDs at which is attached the contact.

Tag[]

owner

The ID of the User that added the contact.

User

workspace

The ID of the Workspace at which is attached the contact.

Workspace

privacy

The privacy of the contact.

object

value

The value of the privacy.

string{WORKSPACE, SELF, CUSTOM}

perms

The privacy permission.

string{READ, SPEAK, WRITE}

allow

An array of User and/or Group IDs who have access.

User[], Group[]

deny

An array of User and/or Group IDs who don't have access.

User[], Group[]

created_time

The date that indicates when the contact was created.

date

updated_time

The date that indicates when the contact was updated for the last time.

date

Computed fields

Name Description Type

name

The name of the contact.
Made by concat first_name field and last_name field.

string

main_mail

The main mail address of the contact.
Taken from mails field (item whose its main field is set to true).

object

type

The type attached to the mail address.

string

address

The mail address.

string

main

If the address is the main mail.

boolean

main_phones

The main phone number of the contact.
Taken from phones field (item whose its main field is set to true).

object

type

The type attached to the phone number.

string

number

The phone number.

string

main

If the number is the main phone.

boolean

main_addresses

The main postal address of the contact.
Taken from addresses field (item whose its main field is set to true).

object

type

The type attached to the postal address.

string

lane_number

The address lane number.

string

lane_name

The address lane name.

string

complement

The address complement.

string

zip

The address zip.

string

city

The address city.

string

region

The address region.

string

country

The address country.

string

main

If the address is the main address.

boolean

Publishing

You can publish contacts by using the /user/contacts, /environment/contacts or /account/contacts edges.

Updating

PUT /contact/{contact-id} HTTP/1.1
Host: localhost:3000

Permissions

  • An access token (pointing to an user) with manage_repertory permission is required.
  • At least one of the following criteria must be met :
    • The contact is owned by the current person.
    • The contact is shared (with MANAGE permission) with the current person.
    • The current person is an admin (with MANAGE permission) of the workspace at witch is attached the contact.

Fields

Name Description Type

first_name

The first name of the contact.

string

last_name

The last name of the contact.

string

type

The type of the contact.

string

job

The job of the contact.

string

avatar

The ID of the Photo that represents the avatar of the contact.
Must be a photo attached to the contact or a photo owned by the current person whose its tmp field is set to true.

string

website_url

The website url of the contact.

string

mails

The mail addresses of the contact.

object[]

type

The type attached to the mail address.

string

address

The mail address.

string

main

If the address is the main mail.

boolean

phones

The phone numbers of the contact.

object[]

type

The type attached to the phone number.

string

number

The phone number.

string

main

If the number is the main phone.

boolean

addresses

The postal addresses of the contact.

object[]

type

The type attached to the postal address.

string

lane_number

The address lane number.

string

lane_name

The address lane name.

string

complement

The address complement.

string

zip

The address zip.

string

city

The address city.

string

region

The address region.

string

country

The address country.

string

main

If the address is the main address.

boolean

notes

Notes about the contact.

string

custom_fields

Custom fields attached to the contact.

object

tags

An array of Tag IDs at which is attached to the contact.
Must be some Tags belonging to the current person workspace.

string[]

privacy

The privacy of the contact.

object

value

The value of the privacy.

string{WORKSPACE, SELF, CUSTOM}

perms

The privacy permission.

string{READ, SPEAK, WRITE}

allow

An array of User and/or Group IDs who have access.

User[], Group[]

deny

An array of User and/or Group IDs who don't have access.

User[], Group[]

Response

If successful :

{
    "success": true
}

Otherwise a relevant error message will be returned.

Deleting

DELETE /contact/{contact-id} HTTP/1.1
Host: localhost:3000

Permissions

  • The applied permissions to update contacts are required.

Fields

No fields are required.

Response

If successful :

{
    "success": true
}

Otherwise a relevant error message will be returned.

Edges

Name Description

/photos

The photos attached to the contact.

/feed

The feed of the contact.