Majority of the API calls to Qobbo can only be made after you have been authenticated by the system. For now, the API uses Basic Authentication over SSL. Email address (which will act as the username) and password are the expected parameters. Basic Authentication needs to be established for all calls that require authentication.
Navigation
Users
List Users
List all users registered.
- API Call: http://www.qobbo.com/index.php/api/users/
- Verb: GET
- Requires Authentication: Yes
- Parameters: None
-
PHP Example:
$username = 'sample@email.com'; $password = '123456'; $serviceUrl = 'http://www.qobbo.com/index.php/api/users'; $curl = curl_init($serviceUrl); $curl_post_data = array(); curl_setopt($curl, CURLOPT_USERPWD, $username . ":" . $password); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $curl_response = curl_exec($curl); curl_close($curl);
-
Response:
array ( 'status' => 'Success' 'message' => null 'errors' => null 'data' => array ( '0' => array ( 'id' => '96' 'email_address' => 'sample@email.com' 'first_name' => 'John' 'middle_name' => '' 'last_name' => 'Doe' 'street_address' => '' 'extended_address' => '' 'locality' => 'Paris, France' 'region' => null 'postal_code' => '' 'country' => null 'default_latitude' => '48.8566' 'default_longitude' => '2.35222' 'geolocation_enabled' => '0' 'social_security_number' => '' 'phone_number' => '' 'avatar' => null 'avatar_extension' => null 'range' => '20' 'qobbo_points' => '345.90' ) '1' => array ( 'id' => '97' 'email_address' => 'sample2@email.com' 'first_name' => 'John' 'middle_name' => null 'last_name' => 'Smith' 'street_address' => null 'extended_address' => null 'locality' => 'Aix-en-Provence, France' 'region' => null 'postal_code' => '' 'country' => null 'default_latitude' => '0' 'default_longitude' => '0' 'geolocation_enabled' => '1' 'social_security_number' => null 'phone_number' => null 'avatar' => null 'avatar_extension' => null 'range' => '20' 'qobbo_points' => '0.00' ) ) )
View User
View a single user. Will return information similar to List Users, with the addition of a list of posted ads by this person. If the authenticated account is has admin rights or has the same account id as the user being lookep up, uploaded documents and created tickets will be returned as well. Replace %d with the id of the user.
- API Call: http://www.qobbo.com/index.php/api/users/%id
- Verb: GET
- Requires Authentication: Yes
- Parameters: None
-
PHP Example:
$username = 'sample@email.com'; $password = '123456'; $serviceUrl = 'http://www.qobbo.com/index.php/api/users/96'; $curl = curl_init($serviceUrl); $curl_post_data = array(); curl_setopt($curl, CURLOPT_USERPWD, $username . ":" . $password); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $curl_response = curl_exec($curl); curl_close($curl);
-
Response:
array ( 'status' => 'Success' 'message' => null 'errors' => null 'data' => array ( 'id' => '96' 'email_address' => 'sample@email.com' 'first_name' => 'John' 'middle_name' => '' 'last_name' => 'Doe' 'street_address' => '' 'extended_address' => '' 'locality' => 'Paris, France' 'region' => null 'postal_code' => '' 'country' => null 'default_latitude' => '48.8566' 'default_longitude' => '2.35222' 'geolocation_enabled' => '0' 'social_security_number' => '' 'phone_number' => '' 'avatar' => null 'avatar_extension' => null 'range' => '20' 'qobbo_points' => '199.90' 'documents' => array ( '0' => array ( 'id' => '15' 'document' => 'http://www.qobbo.com/fileupload/ac94581ebd6fb39fb25358816f7da126c38d2fed.png' 'status' => 'en cours de validation' ) '1' => array ( 'id' => '16' 'document' => 'http://www.qobbo.com/fileupload/7518c46069d0345c7be0d0752622ead94aaf98d2.png' 'status' => 'en cours de validation' ) ) 'tickets' => array ( '0' => array ( 'id' => '4' 'credits' => '10.00' 'serial_number' => '59894fb6b66f3c127' ) '1' => array ( 'id' => '8' 'credits' => '20.00' 'serial_number' => '170954fbfe9766064b' ) ) 'ads' => array ( '0' => array ( 'id' => '235' 'message' => 'Test Ad 1' 'latitude' => '49.8941' 'longitude' => '2.29575' 'city' => 'Amiens' 'price' => '0' 'expiry_date' => '2012-06-21 16:59:43' 'created' => '2012-05-21 16:59:43' ) '1' => array ( 'id' => '242' 'message' => 'Test Message' 'latitude' => '50.8566' 'longitude' => '2.35222' 'city' => 'Paris' 'price' => '0' 'expiry_date' => '2012-06-25 00:00:00' 'created' => '2012-05-24 21:38:58' ) ) ) )
Ads
List Ads
List all ads posted. If the authenticated user does not have admin rights, only published ads will be returned
- API Call: http://www.qobbo.com/index.php/api/ads/
- Verb: GET
- Requires Authentication: Yes
- Parameters: None
-
PHP Example:
$username = 'sample@email.com'; $password = '123456'; $serviceUrl = 'http://www.qobbo.com/index.php/api/ads'; $curl = curl_init($serviceUrl); $curl_post_data = array(); curl_setopt($curl, CURLOPT_USERPWD, $username . ":" . $password); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $curl_response = curl_exec($curl); curl_close($curl);
-
Response:
array ( 'status' => 'Success' 'message' => null 'errors' => null 'data' => array ( '0' => array ( 'id' => '234' 'category_name' => null 'type' => 'Ask' 'status' => 'En cours de modèration' 'poster' => 'Mike' 'message' => 'Test Ad' 'latitude' => '43.6047' 'longitude' => '1.44421' 'city' => 'Toulouse, France' 'price' => '0' 'expiry_date' => '2012-06-15 21:33:18' 'created' => '2012-05-15 21:33:19' ) '1' => array ( 'id' => '235' 'category_name' => null 'type' => 'Bid' 'status' => 'Publiée' 'poster' => 'John' 'message' => 'Test Ad 1' 'latitude' => '49.8941' 'longitude' => '2.29575' 'city' => 'Amiens' 'price' => '0' 'expiry_date' => '2012-06-21 16:59:43' 'created' => '2012-05-21 16:59:43' ) '2' => array ( 'id' => '236' 'category_name' => null 'type' => 'Bid' 'status' => 'Publiée' 'poster' => 'John' 'message' => 'Test Ad 2' 'latitude' => '49.8941' 'longitude' => '2.29575' 'city' => 'Amiens' 'price' => '0' 'expiry_date' => '2012-06-21 17:01:31' 'created' => '2012-05-21 17:01:31' ) ) )
View Ad
View a single ad. Data returned includes information on the ad and the conversations that have taken place inside one, as well as the number of messages inside each conversation. Replace %d with the id of the ad.
- API Call: http://www.qobbo.com/index.php/api/ads/%id
- Verb: GET
- Requires Authentication: Yes
- Parameters: None
-
PHP Example:
$username = 'sample@email.com'; $password = '123456'; $serviceUrl = 'http://www.qobbo.com/index.php/api/ads/234'; $curl = curl_init($serviceUrl); $curl_post_data = array(); curl_setopt($curl, CURLOPT_USERPWD, $username . ":" . $password); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $curl_response = curl_exec($curl); curl_close($curl);
-
Response:
array ( 'status' => 'Success' 'message' => null 'errors' => null 'data' => array ( 'id' => '234' 'category_name' => null 'type' => 'Bid' 'status' => 'Publiée' 'poster' => 'John' 'message' => 'Test Ad 2' 'latitude' => '49.8941' 'longitude' => '2.29575' 'city' => 'Amiens' 'price' => '0' 'expiry_date' => '2012-06-21 17:01:31' 'created' => '2012-05-21 17:01:31' 'conversations' => array ( '0' => array ( 'id' => '13' 'starter' => 'Mike' 'messages_count' => '1' ) ) ) )
Create Ad
Create a new ad. Latitude, longitude, price and expiry date are optional. If no latitude and longitude are provided, coordinates will be automatically calculated from the city entered.
- API Call: http://www.qobbo.com/index.php/api/ads/
- Verb: POST
- Requires Authentication: Yes
-
Parameters:
array ( 'Ad' => array ( 'message' => 'Babysitter Service' 'city' => 'Paris' 'latitude' => '48.8566', 'longitude' => '2.35222', 'price' => '10' 'expiry_date' => '2012-06-25' ) )
-
PHP Example:
$username = 'sample@email.com'; $password = '12345678'; $serviceUrl = 'http://www.qobbo.com/index.php/api/ads'; $curl = curl_init($serviceUrl); $curl_post_data = array( 'Ad[message]' => 'Test Message', 'Ad[city]' => 'Paris', 'Ad[latitude]' => '48.8566', 'Ad[longitude]' => '2.35222', 'Ad[price]' => '0', 'Ad[expiry_date]' => '2012-06-25', ); curl_setopt($curl, CURLOPT_USERPWD, $username . ":" . $password); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $curl_post_data); $curl_response = curl_exec($curl); curl_close($curl);
-
Response:
array ( 'status' => 'Success' 'message' => 'Ad post successfull' 'errors' => null 'data' => null )
Messages
Create Message
Create a new message. There are a few rules here. If you fail to supply the AdMessage[conversation_id] parameter, you need to supply the id of the Ad you wish to post a message for (using Ad[id]). This is needed so that the API can detect if the authenticated user has started a conversation already before for this ad or not, to know whether to auto create a new conversation or not (conversations are unique between 2 users).
- API Call: http://www.qobbo.com/index.php/api/messages/
- Verb: POST
- Requires Authentication: Yes
-
Parameters:
array ( 'AdMessage' => array ( 'message' => 'Hi, I am interested in the service you offer.' 'conversation_id' => '13' ) )
-
PHP Example:
$username = 'sample@email.com'; $password = '12345678'; $serviceUrl = 'http://www.qobbo.com/index.php/api/messages'; $curl = curl_init($serviceUrl); $curl_post_data = array( 'AdMessage[message]' => 'Hi, I am interested in the service you offer.', 'AdMessage[conversation_id]' => '13', ); curl_setopt($curl, CURLOPT_USERPWD, $username . ":" . $password); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $curl_post_data); $curl_response = curl_exec($curl); curl_close($curl);
-
Response:
array ( 'status' => 'Success' 'message' => 'Message successfully posted' 'errors' => null 'data' => null )
Categories
List Ad Categories
List all available ad categories.
- API Call: http://www.qobbo.com/index.php/api/categories/
- Verb: GET
- Requires Authentication: Yes
- Parameters: None
-
PHP Example:
$username = 'sample@email.com'; $password = '123456'; $serviceUrl = 'http://www.qobbo.com/index.php/api/categories'; $curl = curl_init($serviceUrl); $curl_post_data = array(); curl_setopt($curl, CURLOPT_USERPWD, $username . ":" . $password); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $curl_response = curl_exec($curl); curl_close($curl);
-
Response:
array ( 'status' => 'Success' 'message' => null 'errors' => null 'data' => array ( '0' => array ( 'id' => '1' 'parent_category_id' => null 'category_name' => 'logistiQ' ) '1' => array ( 'id' => '2' 'parent_category_id' => null 'category_name' => 'enfant' ) '2' => array ( 'id' => '3' 'parent_category_id' => null 'category_name' => 'maison' ) '3' => array ( 'id' => '4' 'parent_category_id' => null 'category_name' => 'briQoDeQo' ) '4' => array ( 'id' => '5' 'parent_category_id' => null 'category_name' => 'animaux' ) '5' => array ( 'id' => '6' 'parent_category_id' => null 'category_name' => 'hobbies' ) '6' => array ( 'id' => '7' 'parent_category_id' => null 'category_name' => 'green' ) '7' => array ( 'id' => '8' 'parent_category_id' => null 'category_name' => 'geeQ' ) '8' => array ( 'id' => '9' 'parent_category_id' => '1' 'category_name' => 'Livraison' ) '9' => array ( 'id' => '10' 'parent_category_id' => '1' 'category_name' => 'Livraison de croissant' ) '10' => array ( 'id' => '11' 'parent_category_id' => '2' 'category_name' => 'Peri Scolaire' ) '11' => array ( 'id' => '12' 'parent_category_id' => '2' 'category_name' => 'Baby sitting' ) '12' => array ( 'id' => '13' 'parent_category_id' => '3' 'category_name' => 'Menage' ) '13' => array ( 'id' => '14' 'parent_category_id' => '3' 'category_name' => 'Repassage' ) '14' => array ( 'id' => '15' 'parent_category_id' => '4' 'category_name' => 'Plomberie' ) '15' => array ( 'id' => '16' 'parent_category_id' => '4' 'category_name' => 'Montage de meuble' ) '16' => array ( 'id' => '17' 'parent_category_id' => '5' 'category_name' => 'Promenade chien' ) '17' => array ( 'id' => '18' 'parent_category_id' => '5' 'category_name' => 'Garde chat a domicile' ) '18' => array ( 'id' => '19' 'parent_category_id' => '6' 'category_name' => 'Cours particulier math' ) '19' => array ( 'id' => '20' 'parent_category_id' => '6' 'category_name' => 'Coach sportif' ) '20' => array ( 'id' => '21' 'parent_category_id' => '6' 'category_name' => 'Cours de guitare' ) '21' => array ( 'id' => '22' 'parent_category_id' => '6' 'category_name' => 'Cours Tennis' ) '22' => array ( 'id' => '23' 'parent_category_id' => '8' 'category_name' => 'Reparation informatique' ) '23' => array ( 'id' => '24' 'parent_category_id' => '8' 'category_name' => 'Cours Excel' ) ) )
Documents
List Uploaded documents
List all documents posted. Can only be used by authenticated users with admin rights.
- API Call: http://www.qobbo.com/index.php/api/documents/
- Verb: GET
- Requires Authentication: Yes
- Parameters: None
-
PHP Example:
$username = 'sample@email.com'; $password = '123456'; $serviceUrl = 'http://www.qobbo.com/index.php/api/documents'; $curl = curl_init($serviceUrl); $curl_post_data = array(); curl_setopt($curl, CURLOPT_USERPWD, $username . ":" . $password); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $curl_response = curl_exec($curl); curl_close($curl);
-
Response:
array ( 'status' => 'Success' 'message' => null 'errors' => null 'data' => array ( '0' => array ( 'id' => 11 'owner' => 'John' 'document' => 'http://www.qobbo.com/fileupload/cbf83b35f4c8000396d491b84a62a04d2f8c8df8.png' 'original_filename' => '2.png' 'extension' => 'png' 'type' => 'Carte Vitale' 'status' => 'validé' 'date_created' => '2012-05-22 17:38:25' ) '1' => array ( 'id' => 12 'owner' => 'John' 'document' => 'http://www.qobbo.com/fileupload/fede82f08d7c4c6fe5a8c8afca4de80fb71f66ea.png' 'original_filename' => '1.png' 'extension' => 'png' 'type' => 'Carte d’Identité' 'status' => 'en cours de validation' 'date_created' => '2012-05-22 17:38:55' ) ) )
Document Types
List Document Types
List all available document types.
- API Call: http://www.qobbo.com/index.php/api/documenttypes/
- Verb: GET
- Requires Authentication: Yes
- Parameters: None
-
PHP Example:
$username = 'sample@email.com'; $password = '123456'; $serviceUrl = 'http://www.qobbo.com/index.php/api/documenttypes'; $curl = curl_init($serviceUrl); $curl_post_data = array(); curl_setopt($curl, CURLOPT_USERPWD, $username . ":" . $password); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $curl_response = curl_exec($curl); curl_close($curl);
-
Response:
array ( 'status' => 'Success' 'message' => null 'errors' => null 'data' => array ( '0' => array ( 'id' => '1' 'type' => 'Carte d’Identité' ) '1' => array ( 'id' => '2' 'type' => 'Carte Vitale' ) ) )