isogeo_pysdk.api.routes_contact module

Isogeo API v1 - API Routes for Contacts entities

See: http://help.isogeo.com/api/complete/index.html

class isogeo_pysdk.api.routes_contact.ApiContact(api_client=None)

Bases: object

Routes as methods of Isogeo API used to manipulate contacts.

associate_metadata(metadata, contact, role='pointOfContact')

Associate a metadata with a contact.

If the specified contact is already associated, the response is still 200.

Parameters:
  • metadata (Metadata) – metadata object to update
  • contact (Contact) – contact model object to associate
  • role (str) – role to assign to the contact
Example:
# retrieve a metadata
md = isogeo.metadata.get(METADATA_UUID)
# retrieve a contact
ctct = isogeo.contact.get(CONTACT_UUID)
# associate a contact to a metadata
isogeo.contact.associate_metadata(metadata = md, contact = ctct)
Return type:Response
create(workgroup_id, contact, check_exists=1)

Add a new contact to a workgroup.

Parameters:
  • workgroup_id (str) – identifier of the owner workgroup
  • contact (class) – Contact model object to create
  • check_exists (int) –

    check if a contact already exists inot the workgroup:

    • 0 = no check
    • 1 = compare name [DEFAULT]
    • 2 = compare email
Returns:

the created contact or the existing contact if case oof a matching name or email or a tuple with response error code

Return type:

Contact

delete(workgroup_id, contact_id)

Delete a contact from Isogeo database.

Parameters:
  • workgroup_id (str) – identifier of the owner workgroup
  • contact_id (str) – identifier of the resource to delete
dissociate_metadata(metadata, contact)

Removes the association between a metadata and a contact.

If the specified contact is not associated, the response is 404.

Parameters:
  • metadata (Metadata) – metadata object to update
  • contact (Contact) – contact model object to associate
Return type:

Response

exists(contact_id)

Check if the specified contact exists and is available for the authenticated user.

Parameters:contact_id (str) – identifier of the contact to verify
Return type:bool
get(contact_id)

Get details about a specific contact.

Parameters:contact_id (str) – contact UUID
Return type:Contact
listing(self, workgroup_id=None, include=('count', ), caching=1)

Get workgroup contacts.

Parameters:
  • workgroup_id (str) – identifier of the owner workgroup
  • include (tuple) – identifier of the owner workgroup
  • caching (bool) – option to cache the response
Return type:

list

update(contact, caching=1)

Update a contact owned by a workgroup.

Parameters:
  • contact (class) – Contact model object to update
  • caching (bool) – option to cache the response
Return type:

Contact