This class represent the chateagratis API's, this is single abstraction for all API methods.
| author | Xabier Fernández Rodríguez in Ant-Web S.L. |
|---|---|
| package | Ant\ChateaClient\Client |
| see | |
| see | |
| see |
__construct(\Ant\ChateaClient\Service\Client\Client $client)
addAlbum(int $user_id, string $title, string $description) : array | string
| examples | Add Photo Album
$your_api_instance->addAlbum(1,'new Album', 'this is me personal photobook');
array(
"id" => 2,
"participant" => array(
"id" => 1,
"username" => "alex",
"email" => "alex@chateagratis.net"
),
"title" => "new Album",
"description" => "this is me personal photobook"
);
|
|---|
intThe user ID
stringOne name for the Album
stringA short description of type photos
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
arraystringAssociative array with new album data | Message with error in json formataddAlbumPhoto(int $user_id, int $photo_id, int $album_id) : array | string
| examples | Add photo 1 on album 1
$your_api_instance->addAlbumPhoto(1,1,1);
// ouput message
Photo inserted
|
|---|
intThe user id to retrieve data
intThe photo id to insert
intThe album id to retrieve data
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
arraystringAssociative array with the album one user | Message with error in json formataddChanel(string $name, string $title, string $description, string $channel_type) : array | string
| examples |
$your_api_instance->addChanel('new channel name','API - Channel Name',
'This is channel about loves, friends and others', 'love');
|
|---|
stringThe name of channel this is unique
stringThe title of channel
stringThe long description of channel
stringThe type pof channel, This value have a subset available in server, you can view the channels type with command @link #showChannelsTypes()
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
arraystringAssociative array with new channel | Message with error in json formataddFriends(int $user_id, int $friend_id) : string
| examples | Sends a friendship request between user 1 to user 3
$your_api_instance->addFriends(1,3);
|
|---|
intYour user id
intThe user id that retrieve the request
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
stringMassage endorsement , if the request have been sentaddFriendshipRequest(int $user_id, int $user_accept_id) : string
| examples | User 1 accept like new Friend to user 3
$your_api_instance->showFriendshipsRequest(1,3);
Friendship accepted
|
|---|
intThe user id that you retrieve request new Friend
intThe user id pending friendship
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
stringMessage accepted | Message with error in json formataddPhoto(int $user_id, string $imageFile, string $imageTile) : array | string
| examples | Add Photo
$your_api_instance->addPhoto(1,'my face in wall', '/home/alex/my_face_wall.png');
array(
"id" => 9,
"participant" => array(
"id" => 1,
"username" => "alex",
),
"publicated_at" => "2013-10-30T08:11:22+0100",
"path" => "2013/10/30/5270b11b25f5c.png",
"number_votes" => 0,
"_links" => array(
"self" => array(
"href" => "http://api.chateagratis.net/api/photos/9",
),
"creator" => array(
"href" => "http://api.chateagratis.net/api/users/1",
),
"path" => array(
"href" => "http://api.chateagratis.net/uploads/2013/10/30/5270b11b25f5c.png",
"type" => "image/*",
)
)
);
|
|---|
intThe user owner of photo
stringThe path to upload photo
stringThe name of photo
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
arraystringAssociative array with new album data | Message with error in json formataddPhotoVote(int $user_id, int $photo_id, int $score) : array | string
| examples |
array (
"score" => 10,
"photo" => array(
"id" => 6,
"number_votes" => 21,
"score" => 47.571428571428,
),
"_links" => array(
"self" => array(
"href" => "http://api.chateagratis.net/api/users/1/photos/6/votes",
),
"photo" => array(
"href" => "http://api.chatsfree.net/api/photos/6",
),
"participant" => array(
"href" => "http://api.chatsfree.net/api/users/1",
)
)
);
|
|---|
intThe user id to retrieve data
intThe photo id to retrieve data
intThe score photo, The score ha to be between one and ten
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
arraystringAssociative array with you vote | Message with error in json formataddReportPhoto(int $photo_id, string $reason) : array | string
| examples | Add Photo report
$your_api_instance->addReportPhoto(1,'This photo is not adequate');
array(
"reason" => "this is not me photo",
"created_at" => "2013-10-29T12:13:07+0100",
"id" => 9,
);
|
|---|
intThe Photo ID to be reported
stringThe reason this report
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
arraystringAssociative array with report | Message with error in json formataddThread(int $user_id, string $recipient_name, string $subject, string $body) : array | string
| examples | Add new thread
$your_api_instance->addThread(1,'alex2','Subject sample',"this is my body in 1rst message ")
array(
"id" => 5,
"subject" => "Subject sample",
);
|
|---|
intThe user id that create the thread
stringThe ID username that retrieve the message
stringThe short description of thread
stringThe long text of thread
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
arraystringAssociative array with data thread | Message with error in json formataddThreadMessage(int $user_id, int $thread_id, string $body) : array | string
| examples | Add one message on thread
$your_api_instance->showThreadMessages(1,1,'this is entity body');
array(
"id" => 15,
"body" => "this is entity body",
"created_at" => "2013-10-30T14:00:53+0100"
);
|
|---|
intThe user id that create the thread
intThe ID of thread
stringthe text of message
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
arraystringAssociative array with messages | Message with error in json formataddUserBlocked(int $user_id, int $user_blocked_id) : string
| examples | Blocked one user
$your_api_instance->addUserBlocked(1,6);
//output
User blocked
|
|---|
intUser to retrieve by ID
intUser to blocked by ID
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
stringMessage sucessfully if can blocked an user | Message with error in json formataddUserChannelFan(int $channel_id, int $user_id) : string
| examples | add the user 1 fan of channel 1
$your_api_instance->addUserChannelFan(1,1);
The ouput message:The user is a fan of the channel successfully |
|---|
intChannel id to receive a fan
intThe user id will be fan
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
stringMassage ok if user is new fanaddUserProfile(int $user_id, string $about, string $seeking, $gender, $youWant, $birthday) : array | string
| todo | comprobaciones para gender and youWant Add new profile one user |
|---|---|
| examples | Create profile one user
$your_api_instance->addUserProfile(1,'about-10','bisexual');
array(
"id" => 11,
"about" => "about-10",
"seeking" => "bisexual",
"count_visits" => 0,
"publicated_at" => "2013-10-30T16:43:51+0100",
);
|
intUser to retrieve by ID
stringShort description your profile
stringChoice between
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
arraystringAssociative array with profile data | Message with error in json formataddUserReports(int $user_reported_id, string $reason) : array | string
intThe user id that is report
stringDescription for report the user
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error
array(
"reason" => "this user is heterosexual",
"created_at" => "2013-10-30T17:03:29+0100",
"id" => 44,
);
|
arraystringAssociative array with report data | Message with error in json formatchangePassword(string $current_password, string $new_password, string $repeat_new_password) : string
| examples |
$your_api_instance->changePassword('current_password','new_password','repeat_new_password');
//ouput message
Password changed sucessfully
|
|---|
stringyour actual password
stringyour new password
stringrepeat your new password
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
stringmessage password changed sucessfully if your password have been changed | Message with error in json formatdelAlbum(int $user_id, int $album_id) : string
| examples | Delete an abum 1 to user 1
$your_api_instance->delAlbum(1,1);
// ouput message
Album deleted
|
|---|
intThe user id to retrieve data
intThe album id to retrieve data
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
stringMessage sucessfully if can delete the album | Message with error in json formatdelChannel(int $channel_id) : string
| examples |
$your_api_instance->delChannel(96);
|
|---|
intChannel to update by ID
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
stringThe message ok, if channel has been deleteddelFriend(int $user_id, int $user_delete_id) : string
| examples | User 1 delete friendship to user 3
$your_api_instance->delFriend(1,3);
Friendship deleted
|
|---|
intThe user id that you delere friend
intThe user id, you want deleted.
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
stringMessage delete | Message with error in json formatdelFriendshipRequest(int $user_id, int $user_decline_id) : string
| examples | User 1 declined like new Friend to user 3
$your_api_instance->delFriendshipRequest(1,3);
Friendship declined
|
|---|
intThe user id that you decliene new Friend
intThe user id pending friendship
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
stringMessage declined | Message with error in json formatdelMe() : string
| examples | Delete me user
$your_api_instance->delMe();
//ouput message
User deleted
|
|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
|---|
stringMessage deleted user | Message with error in json formatdelPhoto(int $photo_id) : string
| examples | Delete Photo
$your_api_instance->delPhoto(1);
Photo deleted
|
|---|
intThe photo id you like deleting
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
stringMessage sucessfully if can delete the photo | Message with error in json formatdelPhotoAlbum(int $user_id, int $photo_id) : string
| examples | Delete an abum 1 to user 1
$your_api_instance->delAlbum(1,1);
Photo deleted of Album
|
|---|
intThe user id to retrieve data
intThe photo id to retrieve data
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
stringMessage sucessfully if can delete photo of album | Message with error in json formatdelPhotoVote(int $user_id, int $photo_id) : string
| examples | Delete one vote of photo 6
$your_api_instance->delPhotoVote(1,6);
//output
Vote deleted
|
|---|
intThe user id to delete data
intThe phot id to delete vote
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
stringMessage sucessfully if can delete the vote | Message with error in json formatdelThread(int $user_id, int $thread_id) : string
| examples | Delete thread 6
$your_api_instance->delThread(6);
//ouput message
Thread deleted
|
|---|
intThe user id that create the thread
intThe ID of thread
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
stringMessage sucessfully if can delete thread | Message with error in json formatdelUserBlocked(int $user_id, int $user_blocked_id) : string
| exampless | Unblocked one user
$your_api_instance->delUserBlocked(1,6);
//output
User unblocked
|
|---|
intUser to retrieve by ID
intUser to blocked by ID
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
stringMessage sucessfully if can blocked an user | Message with error in json formatdelUserChannelFan(int $channel_id, int $user_id) : string
| examples | remove the user 1 fan of channel 1
$your_api_instance->delUserChannelFan(1,1);
|
|---|
intChannel id to receive a fan
intThe user id will be fan
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
stringMassage ok if user is not fanforgotPassword(string $username_or_email) : string
| examples | Request reset the user password
$your_api_instance->forgotPassword('you_user_name');
$your_api_instance->forgotPassword('you_email@antwebs.es');
|
|---|
stringThe user email or username
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
stringmessage ok message if your new password have been sentlogout() : string
| exampless |
$your_api_instance->logout()
//Sample output
Access token revoked
|
|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
|---|
stringa message ok and the HTTP status code 200me()
| examples |
$your_api_instance->me();
array(
'id' => '1',
'username' => 'xabier',
'email' => 'xabier@antweb.es',
"_links" => array(
"self" => array(
"href" => "http://api.chateagratis.net/api/users/1",
),
"channels" => array(
"href" => "http://api.chateagratis.net/api/users/1/channels",
),
"channels_fan" => array(
"href" => "http://api.chateagratis.net/api/users/1/channelsFan",
),
"blocked_users" => array(
"href" => "http://api.chateagratis.net/api/users/1/blocked",
)
)
);
|
|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
|---|
register(string $username, string $email, string $new_password, string $repeat_new_password, string $affiliate_host, $ip) : array | string
| examples | Register new user at server
$your_api_instance->register('new user name','new_password','repeat_new_password','your hosts name');
|
|---|
stringThe name of user. This is unique for user
stringThe email for user. This is unique for user
stringThe user password
stringRepeat the password
stringThe name of your server, where you make send request. You don't use protocols (http:// or ftp ) or subdomains only use primary name
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
arraystringAssociative array with you profile | Message with error in json formatsetUserNick(int $user_id, string $nick) : string | string
intThe id of the user to set the nick
stringDescription for report the user
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error
array(
"nick" => "mysupernick",
"id" => 44,
);
|
stringstringSuccessfull message | Message with error in json formatshowAlbum(int $user_id, int $album_id) : array | string
| examples | Show an abum 1 to user 1
$your_api_instance->showUserAlbum(1,1);
array(
"id" => 1,
"title" => "la foto 1",
"description" => "default album",
"_links" => array(
"self" => array(
"href" => "http://api.chatsfree.net/api/users/1/albums/1",
),
"participant" => array(
"href" => "http://api.chatsfree.net/api/users/1",
),
"photos" => array(
"href" => "http://api.chatsfree.net/api/albums/1/photos",
)
)
);
|
|---|
intThe user id to retrieve data
intThe album id to retrieve data
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
arraystringAssociative array with the album one user | Message with error in json formatshowAlbums(int $user_id, int $limit, int $offset) : array | string
| examples | Show all abums to user 1, only 1rst
$your_api_instance->showUserAlbums(1);
array(
"total" => 1,
"limit" => 1,
"offset" => 0,
"_links" => array(
"self" => array(
"href" => "http://api.chatsfree.net/api/users/1/albums",
)
),
"resources" => array(
array(
"id" => 1,
"title" => "la foto 1",
"description" => "default album",
"_links" => array(
"self" => array(
"href" => "http://api.chatsfree.net/api/users/1/albums/1",
),
"participant" => array(
"href" => "http://api.chatsfree.net/api/users/1",
),
"photos" => array(
"href" => "http://api.chatsfree.net/api/albums/1/photos",
)
)
)
)
);
|
|---|
intThe user id to retrieve data
intnumber of items to retrieve at most
intThe distance (displacement) from the start of a data
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
arraystringAssociative array with all albums one user | Message with error in json formatshowChannel(int $channel_id) : array | string
| examples |
$your_api_instance->showChannel(96);
//Sample Ouput
array(
"id" =>96
"name" =>"update channel name",
"slug" =>"update-channel-name",
"title" =>"API - Channel title",
"description" =>"This is channel about loves, friends and others",
"owner" => array(
"id" =>1
"username" =>"alex"
),
"channel_type" => array(
"name" =>"love"
),
"_links" => array(
"self" => array(
"href" =>"https://api.chatsfree.net/api/channels/96"
),
"fans" => array(
"href" =>"https://api.chatsfree.net/api/channels/96/fans"
),
"owner" => array(
"href" =>"https://api.chatsfree.net/api/users/1"
)
)
);
|
|---|
intChannel to retrieve by ID
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
arraystringAssociative array with channel data | Message with error in json formatshowChannelFans(int $channel_id, int $limit, int $offset) : array | string
| examples | Show Channels Fans of channel 2, only the first
$your_api_instance->showChannelFans(3,1,0);
|
|---|
intChannel to retrieve fans
intnumber of items to retrieve at most
intThe distance (displacement) from the start of a data
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
arraystringAssociative array with users that are fans a channel | Message with error in json formatshowChannels(int $limit, int $offset, array $filter, array $order) : array | string
| examples | Get first twenty channels what type is love
$your_api_instance->showChannels(25,0, array('channelType'=>'love'), array('name' => 'desc'));
|
|---|
intnumber of items to retrieve at most
intThe distance (displacement) from the start of a data
arrayAssociative array with format filter_name =>value_name
arrayAssociative array with format order_field => order
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
arraystringAssociative array with channels data | Message with error in json formatshowChannelsTypes(int $limit, int $offset) : array | string
| examples | Show Channels types, only the first
$your_api_instance->showChannelsTypes(1,0);
|
|---|
intnumber of items to retrieve at most
intThe distance (displacement) from the start of a data
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
|---|---|
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
arraystringAssociative array with channels types use one channel | Message with error in json formatshowFriends(int $user_id, int $limit, int $offset) : array | string
| examples | Show User friends for user id = 1, only the first friend
$your_api_instance->showFriends(1,1,0);
array(
"total" => 4,
"limit" => 1,
"offset" => 0,
"_links" => array(
"self" => array(
"href" => "http://api.chateagratis.net/api/users/1/friends",
),
),
"resources" => array(
array(
"id" => 3,
"username" => "alex3",
"email" => "alex3@chateagratis.net",
"_links" => array(
"self" => array(
"href" => "http://api.chateagratis.net/api/users/3",
),
"channels" => array(
"href" => "http://api.chateagratis.net/api/users/3/channels",
),
"channels_fan" => array(
"href" => "http://api.chateagratis.net/api/users/3/channelsFan",
),
"blocked_users" => array(
"href" => "http://api.chateagratis.net/api/users/3/blocked",
),
),
),
)
);
|
|---|
intThe user id retrieve friends
intnumber of items to retrieve at most
intThe distance (displacement) from the start of a data
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
arraystringAssociative array with users's are friends one user | Message with error in json formatshowFriendshipsPending(int $user_id, int $limit, int $offset) : array | string
| examples | Show a friendship pending by user 1, only the first friendship
$your_api_instance->showFriendshipsPending(1);
array(
"total" => 4,
"limit" => 1,
"offset" => 0,
"_links" => array(
"self" => array(
"href" => "http://api.chateagratis.net/api/users/1/friends/pending",
),
),
"resources" => array(
array(
"id" => 3,
"username" => "alex3",
"username_canonical" => "alex3",
"email" => "alex3@chateagratis.net",
"_links" => array(
"self" => array(
"href" => "http://api.chateagratis.net/api/users/3",
),
"channels" => array(
"href" => "http://api.chateagratis.net/api/users/3/channels",
),
"channels_fan" => array(
"href" => "http://api.chateagratis.net/api/users/3/channelsFan",
),
"blocked_users" => array(
"href" => "http://api.chateagratis.net/api/users/3/blocked",
),
)
)
)
);
|
|---|
intThe user id that you retrieve data
intnumber of items to retrieve at most
intThe distance (displacement) from the start of a data
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
arraystringAssociative array with users's are friends one user | Message with error in json formatshowFriendshipsRequest(int $user_id, int $limit, int $offset) : array | string
| examples | Show the friendship requests sent by user 1, only the first request friendship
$your_api_instance->showFriendshipsRequest(1,1,0);
array(
"total" => 4,
"limit" => 1,
"offset" => 0,
"_links" => array(
"self" => array(
"href" => "http://api.chateagratis.net/api/users/1/friends/pending",
),
),
"resources" => array(
array(
"id" => 3,
"username" => "alex3",
"username_canonical" => "alex3",
"email" => "alex3@chateagratis.net",
"_links" => array(
"self" => array(
"href" => "http://api.chateagratis.net/api/users/3",
),
"channels" => array(
"href" => "http://api.chateagratis.net/api/users/3/channels",
),
"channels_fan" => array(
"href" => "http://api.chateagratis.net/api/users/3/channelsFan",
),
"blocked_users" => array(
"href" => "http://api.chateagratis.net/api/users/3/blocked",
),
)
)
)
);
|
|---|
intThe user id that you retrieve data
intnumber of items to retrieve at most
intThe distance (displacement) from the start of a data
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
arraystringAssociative array with users's are friends one user | Message with error in json formatshowPhoto(string $photo_id) : array | string
| examples | Show a photo
$your_api_instance->showPhoto(1);
array(
"id" => 1,
"participant" => array(
"id" => 1,
"username" => "alex",
),
"publicated_at" => "2013-10-29T12:27:34+0100",
"path" => "photo1-path.jpg",
"title" => "la foto 1",
"number_votes" => 15,
"score" => 15,
"album" => array(
"id" => 1,
"title" => "la foto 1",
"description" => "default album",
),
"_links" => array(
"self" => array(
"href" => "http://api.chateagratis.net/api/photos/1",
),
"creator" => array(
"href" => "http://api.chateagratis.net/api/users/1",
),
"path" => array(
"href" => "http://api.chateagratis.net/api/users/uploads/photo1-path.jpg",
"type" => "image/*",
),
"album" => array(
"href" => "http://api.chateagratis.net/api/users/1/albums/1",
),
)
);
|
|---|
stringThe photo ID that you to retrieve data
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
arraystringAssociative array with photo data | Message with error in json formatshowPhotoAlbum(string $album_id, int $limit, int $offset) : array | string
| examples | Show first photo of photo album
$your_api_instance->showPhotoAlbum(1);
array(
"total" => 6,
"limit" => 1,
"offset" => 0,
"_links" => array(
"self" => array(
"href" => "http://api.chateagratis.net/api/albums/1/photos",
)
),
"resources" => array(
array(
"id" => 1,
"participant" => array(
"id" => 1,
"username" => "alex",
),
"publicated_at" => "2013-10-29T12:27:34+0100",
"path" => "photo1-path.jpg",
"title" => "la foto 1",
"number_votes" => 15,
"score" => 15,
"_links" => array(
"self" => array(
"href" => "http://api.chateagratis.net/api/photos/1",
),
"creator" => array(
"href" => "http://api.chateagratis.net/api/users/1",
),
"path" => array(
"href" => "http://api.chateagratis.net/api/users/uploads/photo1-path.jpg",
"type" => "image/*",
),
"album" => array(
"href" => "http://api.chateagratis.net/api/users/1/albums/1",
),
),
),
)
);
|
|---|
stringThe photo album ID that you to retrieve data
intnumber of items to retrieve at most
intThe distance (displacement) from the start of a data
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
arraystringAssociative array with photos an album | Message with error in json formatshowPhotoVotes(int $user_id, int $photo_id) : array | string
| examples | Show score User id 1 had put to 5 photo $your_api_instance->showPhotoVotes(1,5); array( "score" => 100, "photo" => array( "id" => 5, "number_votes" => 15, "score" => 55, ), "_links" => array( "self" => array( "href" => "http://api.chateagratis.net/api/users/1/photos/5/votes", ), "photo" => array( "href" => "http://api.chateagratis.net/api/photos/5", ), "participant" => array( "href" => "http://api.chateagratis.net/api/users/1", ) ) ); |
|---|
intThe user id to retrieve data
intThe photo id to retrieve data
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
arraystringAssociative array with photos an album | Message with error in json formatshowReport(int $report_id) : array | string
| examples | Show report ID 1
$your_api_instance->showReport(1);
array(
"reason" => "I dislike a lot this guy",
"created_at" => "2013-08-27T15:01:01+0200",
"reviewed_at" => "2013-08-27T16:01:01+0200",
"id" => 1,
"_links" => array(
"self" => array(
"href" => "http://api.chatsfree.net/api/reports/1",
),
"reporter" => array(
"href" => "http://api.chatsfree.net/api/users/1",
),
"resource" => array(
"href" => "http://api.chatsfree.net/api/users/2",
)
)
);
|
|---|
intThe report id to retrieve data
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
arraystringAssociative array with all albums one user | Message with error in json formatshowReports(int $limit, int $offset) : array | string
| examples | Show all reports, only 1rst
$your_api_instance->showReports();
array(
"total" => 42,
"limit" => 1,
"offset" => 0,
"_links" => array(
"self" => array(
"href" => "http://api.chatsfree.net/api/reports",
)
),
"resources" => array(
array(
"reason" => "I dislike a lot this guy",
"created_at" => "2013-08-27T15:01:01+0200",
"reviewed_at" => "2013-08-27T16:01:01+0200",
"id" => 1,
"_links" => array(
"self" => array(
"href" => "http://api.chatsfree.net/api/reports/1",
),
"reporter" => array(
"href" => "http://api.chatsfree.net/api/users/1",
),
"resource" => array(
"href" => "http://api.chatsfree.net/api/users/2",
)
)
)
)
);
|
|---|
intnumber of items to retrieve at most
intThe distance (displacement) from the start of a data
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
arraystringAssociative array with all albums one user | Message with error in json formatshowThreadMessages(int $user_id, int $thread_id) : array | string
| examples | Show messages on thread
$your_api_instance->showThreadMessages(1,1);
array(
array(
"id" => 1,
"body" => "este es el contenido del msg 1",
"created_at" => "2013-08-25T15:01:01+0200",
),array(
"id" => 2,
"body" => "este es el contenido del msg 2",
"created_at" => "2013-08-25T15:31:01+0200",
)
);
|
|---|
intThe user id that create the thread
intThe ID of thread
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
arraystringAssociative array with messages | Message with error in json formatshowThreadsInbox(int $user_id) : array | string
| examples | Show messages inbox
$your_api_instance->addThread(1);
array(
array(
"id" => 1,
"subject" => "hola thread 1",
),
array(
"id" => 4,
"subject" => "hola thread 4",
)
);
|
|---|
intThe user id see her/his inbox
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
arraystringAssociative array with the subject | Message with error in json formatshowThreadsSent(int $user_id) : array | string
| examples | Show messages sent
$your_api_instance->showThreadsSent(1);
array(
array(
"id" => 1,
"subject" => "thread sent 1",
),
array(
"id" => 4,
"subject" => "thread sent 2",
)
);
|
|---|
intThe user id see her/his sent messages
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
arraystringAssociative array with the subject | Message with error in json formatshowUser(int $user_id) : array | string
| examples | Show user with DI 1
$your_api_instance->showUser();
array(
"id" => 1,
"username" => "alex",
"email" => "alex@chateagratis.net",
"_links" => array(
"self" => array(
"href" => "http://api.chatsfree.net/api/users/1",
),
"channels" => array(
"href" => "http://api.chatsfree.net/api/users/1/channels",
),
"channels_fan" => array(
"href" => "http://api.chatsfree.net/api/users/1/channelsFan",
),
"blocked_users" => array(
"href" => "http://api.chatsfree.net/api/users/1/blocked",
)
)
);
|
|---|
intUser to retrieve by ID
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
arraystringAssociative array with user data | Message with error in json formatshowUserChannels(int $user_id, int $limit, int $offset) : array | string
| examples | Show Channels created by user id = 1, only the first channel
$your_api_instance->showUserChannels(1,1,0);
array(
"total" => 32,
"limit" => 32,
"offset" => 0,
"_links" => array(
"self" => array(
"href" => "http://api.chateagratis.net/api/users/1/channels",
),
),
"resources" => array(
array(
"id" => 1,
"name" => "channel 1",
"slug" => "channel-1",
"owner" => array(
"id" => 1,
"username" => "alex",
),
"channel_type" => array(
"name" => "adult",
),
"_links" => array(
"self" => array(
"href" => "http://api.chateagratis.net/api/channels/1",
),
"fans" => array(
"href" => "http://api.chateagratis.net/api/channels/1/fans",
),
"owner" => array(
"href" => "http://api.chateagratis.net/api/users/1",
),
)
)
)
);
|
|---|
intUser id to retrieve channel
intnumber of items to retrieve at most
intThe distance (displacement) from the start of a data
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
arraystringAssociative array with channels created one user | Message with error in json formatshowUserChannelsFan(int $user_id, int $limit, int $offset) : array | string
| examples | Show Channels favorites for user id = 1, only the first channel
$your_api_instance->showUserChannelsFan(1,1,0);
array(
"total" => 2,
"limit" => 1,
"offset" => 0,
"_links" => array(
"self" => array(
"href" => "http://api.chateagratis.net/api/users/1/channelsFan"
),
),
"resources" => array(
array(
"id" => 2,
"name" => "channel 2",
"slug" => "channel-2",
"_links" => array(
"self" => array(
"href" => "http://api.chateagratis.net/api/channels/2"
),
"fans" => array(
"href" => "http://api.chateagratis.net/api/channels/2/fans",
),
"owner" => array(
"href" => "http://api.chateagratis.net/api/users/2"
)
)
)
)
);
|
|---|
intUser id to retrieve fans channels
intnumber of items to retrieve at most
intThe distance (displacement) from the start of a data
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
arraystringAssociative array with channel's is fan one user | Message with error in json formatshowUserPhotoVotes(int $user_id, int $limit, int $offset) : array | string
| examples | Show votes User id 1 had put to all photos, only first voto
$your_api_instance->showUserPhotoVotes(1,1,0);
array(
"total" => 3,
"limit" => 1,
"offset" => 0,
"_links" => array(
"self" => array(
"href" => "http://api.chatsfree.net/api/users/1/votes",
)
),
"resources" => array(
array(
"score" => 3,
"photo" => array(
"id" => 2,
"number_votes" => 25,
"score" => 25,
),
"_links" => array(
"self" => array(
"href" => "http://api.chatsfree.net/api/users/1/photos/2/votes",
),
"photo" => array(
"href" => "http://api.chatsfree.net/api/photos/2",
),
"participant" => array(
"href" => "http://api.chatsfree.net/api/users/1",
)
)
)
)
);
|
|---|
intThe user id to retrieve data
intnumber of items to retrieve at most
intThe distance (displacement) from the start of a data
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
arraystringAssociative array with all votes one user | Message with error in json formatshowUserPhotos(int $user_id, int $limit, int $offset) : array | string
| examples | Show photos of user id, only the first
$your_api_instance->showUserPhotos(1,1,0);
array (
"total" => 40,
"limit" => 1,
"offset" => 0,
"_links" => array(
"self" => array(
"href" => "http://api.chateagratis.net/api/users/1/photos",
),
),
"resources" => array(
array(
"id" => 1,
"participant" => array(
"id" => 1,
"username" => "alex",
),
"publicated_at" => "2013-10-29T12:27:34+0100",
"path" => "photo1-path.jpg",
"title" => "la foto 1",
"number_votes" => 15,
"score" => 15,
"album" => array(
"id" => 1,
"title" => "la foto 1",
"description" => "default album",
),
"_links" => array(
"self" => array(
"href" => "http://api.chateagratis.net/api/photos/1",
),
"creator" => array(
"href" => "http://api.chateagratis.net/api/users/1",
),
"path" => array(
"href" => "http://api.chateagratis.net/api/users/uploads/photo1-path.jpg",
"type" => "image/*",
),
"album" => array(
"href" => "http://api.chateagratis.net/api/users/1/albums/1",
)
)
)
);
|
|---|
intThe user id to retrieve data
intnumber of items to retrieve at most
intThe distance (displacement) from the start of a data
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
arraystringAssociative array with photos an album | Message with error in json formatshowUserProfile(int $user_id) : array | string
| examples | Create profile one user
$your_api_instance->showUserProfile(1);
array(
"id" => 11,
"about" => "about-10",
"seeking" => "bisexual",
"count_visits" => 0,
"publicated_at" => "2013-10-30T16:43:51+0100",
);
|
|---|
intUser to retrieve by ID
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
arraystringAssociative array with profile data | Message with error in json formatshowUserVisitors(int $user_id, int $limit, int $offset) : array | string
| exampless |
$your_api_instance->showUserVisitors(1);
// Sample output
array(
array(
"participant" => array(
"id" => 1,
"username" => "alex",
"email" => "alex@chateagratis.net",
),
"participant_voyeur" => array(
"id" => 2,
"username" => "alex2",
"email" => "alex2@chateagratis.net",
),
"frequency" => 1,
)
);
|
|---|
intUser to retrieve by ID
intnumber of items to retrieve at most
intThe distance (displacement) from the start of a data
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
arraystring
showUsers(int $limit, int $offset, $filters, $order) : array | string
| examples | Show all users, only first
$your_api_instance->showUsers();
array(
"total" => 12,
"limit" => 1,
"offset" => 0,
"_links" => array(
"self" => array(
"href" => "http://api.chatsfree.net/api/users",
)
),
"resources" => array(
array(
"id" => 1,
"username" => "alex",
"email" => "alex@chateagratis.net",
"_links" => array(
"self" => array(
"href" => "http://api.chatsfree.net/api/users/1",
),
"channels" => array(
"href" => "http://api.chatsfree.net/api/users/1/channels",
),
"channels_fan" => array(
"href" => "http://api.chatsfree.net/api/users/1/channelsFan",
),
"blocked_users" => array(
"href" => "http://api.chatsfree.net/api/users/1/blocked",
)
)
)
)
);
|
|---|
intnumber of items to retrieve at most
intThe distance (displacement) from the start of a data
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
arraystringAssociative array with all users | Message with error in json formatshowUsersBlocked(int $user_id, int $limit, int $offset) : array | string
| examples | Show all users blocked, only first
$your_api_instance->showUsersBlocked(1);
array(
"total" => 2,
"limit" => 1,
"offset" => 0,
"_links" => array(
"self" => array(
"href" => "http://api.chatsfree.net/api/users",
)
),
"resources" => array(
array(
"id" => 2,
"username" => "alex2",
"email" => "alex2@chateagratis.net",
"_links" => array(
"self" => array(
"href" => "http://api.chatsfree.net/api/users/2",
),
"channels" => array(
"href" => "http://api.chatsfree.net/api/users/2/channels",
),
"channels_fan" => array(
"href" => "http://api.chatsfree.net/api/users/2/channelsFan",
),
"blocked_users" => array(
"href" => "http://api.chatsfree.net/api/users/2/blocked",
)
)
)
)
);
|
|---|
intUser to retrieve by ID
intnumber of items to retrieve at most
intThe distance (displacement) from the start of a data
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
arraystringAssociative array with all users blocked | Message with error in json formatupdateChannel(int $channel_id, string $name, string $title, string $description, string $channel_type) : array | string
| exampless |
$your_api_instance->updateChannel(96, 'update channel name','API - Channel title',
'This is channel about loves, friends and others', 'love');
|
|---|
intChannel to update by ID
stringThe new name of channel, if you would like update this field.
stringThe new title of channel, if you would like update this field.
stringThe new description, of channel if you would like update this field.
stringThe type, of channel if you would like update this field.
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
arraystringAssociative array with updated channel | Message with error in json formatupdateMe(string $username, string $email, string $current_password) : array | string
| examples |
$your_api_instance->updateMe('xabier','xabier@antweb.es','mySecretPassword');
array(
'id' => '1',
'username' => 'xabier',
'email' => 'xabier@antweb.es',
);
|
|---|
stringyour user name | the new username
stringyour email | the new user email
stringyour password. This method can not change your password for this use @link #changePassword
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
arraystringAssociative array with you profile updated | Message with error in json formatupdateUserProfile(int $user_id, string $about, string $seeking) : array | string
| examples | Update profile an user
$your_api_instance->updateUserProfile(1,'about-103156','homosexual'));
array(
"id" => 11,
"about" => "about-10",
"seeking" => "homosexual",
"count_visits" => 0,
"publicated_at" => "2013-10-30T16:43:51+0100",
);
|
|---|
intUser to retrieve by ID
stringShort description your profile
stringChoice between
\InvalidArgumentException |
This exception is thrown if any parameter has errors |
|---|---|
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
arraystringAssociative array with profile data | Message with error in json formatwho($limit, $offset)
whoami()
associativeArrayToString(array $data) : string
| examples | Convert associative array to string
$this->associativeArrayToString(arrary('key1' => 'value1', 'key2' => 'value2'))
//output
"key1=value1,key2=value2"
|
|---|
arrayThe associative array to convert to string
stringexecuteCommand(\Guzzle\Service\Command\CommandInterface $command) : array | string
\Ant\ChateaClient\Client\ApiException |
This exception is thrown if server send one error |
|---|
arraystringreturn a collection of data or a message. | Message with error in json format