Ofuz Contact API

Add & search contacts

REST

Commands default is the key and command name.

The end point is api.php

   http://www.ofuz.net/api.php?key=<your ofuz api key>&format=json

Will be the base for all request and will use json as send and receive format. Currently there are 3 possible formats to exchange objects: xml, php and json

Often the API will add a message in the different exchanges. They are in an Array with the following format

  Array [ msg : text message
          stat: ok or false
          code: numerical message number for reference ]    

add_contact

Params

Required

 firstname
 lastname

Optional

  
 tags (separated with comas)
 position
 company
 email_work
 email_home
 email_other
 phone_work
 phone_home
 mobile_number
 fax_number
 phone_other
 company_website
 personal_website
 twitter_profile_url
 linkedin_profile_url
 facebook_profile_url
 blog_url

Return value

If successful it will return an array with a msg and idcontact

  Array [ msg : <string message>,
          stat: ok or false
          code: <numerical for ref>
          idcontact: <numerical id of a contact>]

That idcontact is required to use the add_note, add_tag, delete_tag or add_task method.

search_contact

This method will get a partial firstname, lastname or email and return an array of contacts with idcontacts, firstname, lastname, position, company and email address matching that keyword.

Params

 firstname (string)
 lastname  (string)
 email     (string)

Return

if a match is found its an Array of contacts.

  Array [ idcontact : <numerical_id>,
          firstname : <string>,
          lastname  : <string>,
          position  : <string>,
          company   : <string>,
          email     : <string>]

get_contact_id

Will return the idcontact of one specific searched contact.

humm FIXME

this seems to be a duplicate method with apiSearchContact

get_contacts

Doesn't need any params and return all the users contacts

Return

Return all the users contacts in an array with the following values

Arrays [ idcontact       : <numerical_id>,
         firstname       : <string>,
         lastname        : <string>,
         company         : <string>,
         position        : <string>,
         email_address   : <string>,
         phone_number    : <string>,
         company_website : <string>,
         contact_photo   : <url_string>,
         idcompany       : <numerical_id>,
         tag_name        : <coma_separated_string>]

add_tag

add one or more tags to a contact.

it requires an idcontact of an existing contact. contact_search can be used to get the idcontact of an existing contact.

Param

 idreference (idcontact)
 tags  (if more than one, separated with comas) 

Return

Just a message added on success or various error message if parameters are missing or the contact is not found.

delete_tag

Will delete on or more tags. It requires an idcontact to delete the tags from.

Param

idreference (idcontact)

 tags (to be deleted from the contact)

Return

A messages if success of failed.

add_note

Add a note to a contact. This method requires a idcontact. The idcontact of a contact can be retrieved with the search_contact method.

It also requires a note_visibility parameter, if empty its by default visible to the ofuz user, contact, and its coworkers. The note_visibility value is a string with one to 3 word to design which group can few the note.

  note_visibility = "user coworker contact"

means the ofuz user, his co-worker assign with the contacts and the contact it self through the contact portal can view that notes.

 note_visibility = "user"

Only the Ofuz user owning that contact can view the note.

Param

 idcontact
 note (limited to 200 char)
 note_visibility

Return

Just messages

add_task

This will add a task to the ofuz's user.

Only the task description is required. It optionally accept an idcontact to attached the task to a contact, idcontact can be retrieved using the contact_search.

The due_date format is YYYY-MM-DD

Param

 task_description (String)
 idcontact
 due_date (YYYY-MM-DD)

Return

Just nice messages

PHP example

 
contact_rest_api.txt · Last modified: 2010/07/28 14:07 (external edit)
 
Copyright © SQLFusion LLC all rights reserved