This class interface contains all command that run in api server.
Methods
Add new Photo Album in user accont
addAlbum(\Ant\ChateaClient\Client\number $user_id, string $title, string $description) : array | string
| example |
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"
); |
Parameters
$title
stringOne name for the Album
$description
stringA short description of type photos
Exceptions
Returns
arraystringAssociative array with new album data | Message with error in json format
Insert a photo entity into album id
addAlbumPhoto(\Ant\ChateaClient\Client\number $user_id, \Ant\ChateaClient\Client\number $photo_id, \Ant\ChateaClient\Client\number $album_id) : array | string
| example |
photo 1 on album 1
$your_api_instance->addAlbumPhoto(1,1,1);
// ouput message
Photo inserted |
Parameters
Exceptions
Returns
arraystringAssociative array with the album one user | Message with error in json format
Create un new Channel
addChanel(string $name, string $title, string $description, string $channel_type) : array | string
| example |
channel name','API - Channel Name',
'This is channel about loves, friends and others', 'love');
Sample Ouput
array(
"id" =>96
"name" =>"new channel name",
"slug" =>"new-channel-name",
"title" =>"API - Channel Name",
"description" =>"This is channel about loves, friends and others",
"owner" => array(
"id" =>1
"username" =>"alan"
),
"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"
)
)
); |
Parameters
$name
stringThe name of channel this is unique
$title
stringThe title of channel
$description
stringThe long description of channel
$channel_type
stringThe type pof channel, This value have a subset available in server,
you can view the channels type with command @link #showChannelsTypes()
Exceptions
Returns
arraystringAssociative array with new channel | Message with error in json format
Sends a friendship request between two users
addFriends(\Ant\ChateaClient\Client\number $user_id, \Ant\ChateaClient\Client\number $friend_id) : string
| example |
a friendship request between user 1 to user 3
$your_api_instance->addFriends(1,3); |
Parameters
Exceptions
Returns
stringMassage endorsement , if the request have been sent
Accept request new Friend
addFriendshipRequest(\Ant\ChateaClient\Client\number $user_id, \Ant\ChateaClient\Client\number $user_accept_id) : string
| example |
accept like new Friend to user 3
$your_api_instance->showFriendshipsRequest(1,3);
Friendship accepted |
Parameters
Exceptions
Returns
stringMessage accepted | Message with error in json format
upload new photo at server api
addPhoto(\Ant\ChateaClient\Client\number $user_id, string $imageFile, string $imageTile) : array | string
| example |
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/*",
)
)
); |
Parameters
$imageFile
stringThe path to upload photo
$imageTile
stringThe name of photo
Exceptions
Returns
arraystringAssociative array with new album data | Message with error in json format
Add one vote at photo
addPhotoVote(\Ant\ChateaClient\Client\number $user_id, \Ant\ChateaClient\Client\number $photo_id, int $score) : array | string
| example |
(
"score" => 10,
"photo" => array(
"id" => 6,
"number_votes" => 21,
"score" => 47.571428571428,
),
"_links" => array(
"self" => array(
"href" => "http://api.chatsfree.net/app_dev.php/api/users/1/photos/6/votes",
),
"photo" => array(
"href" => "http://api.chatsfree.net/app_dev.php/api/photos/6",
),
"participant" => array(
"href" => "http://api.chatsfree.net/app_dev.php/api/users/1",
)
)
); |
Parameters
$score
intThe score photo, The score ha to be between one and ten
Exceptions
Returns
arraystringAssociative array with you vote | Message with error in json format
Report a photo
addReportPhoto(\Ant\ChateaClient\Client\number $photo_id, string $reason) : array | string
| example |
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,
); |
Parameters
$reason
stringThe reason this report
Exceptions
Returns
arraystringAssociative array with report | Message with error in json format
Create new thread
addThread(\Ant\ChateaClient\Client\number $user_id, string $recipient_name, string $subject, string $body) : array | string
| example |
new thread
$your_api_instance->addThread(1,'alex2','Subject sample',"this is my body in 1rst message ")
array(
"id" => 5,
"subject" => "Subject sample",
); |
Parameters
$recipient_name
stringThe ID username that retrieve the message
$subject
stringThe short description of thread
$body
stringThe long text of thread
Exceptions
Returns
arraystringAssociative array with data thread | Message with error in json format
Add one message on thread
addThreadMessage(\Ant\ChateaClient\Client\number $user_id, \Ant\ChateaClient\Client\number $thread_id, string $body) : array | string
| example |
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"
); |
Parameters
$body
stringthe text of message
Exceptions
Returns
arraystringAssociative array with messages | Message with error in json format
Blocked one user
addUserBlocked(\Ant\ChateaClient\Client\number $user_id, \Ant\ChateaClient\Client\number $user_blocked_id) : string
| example |
one user
$your_api_instance->addUserBlocked(1,6);
//output
User blocked |
Parameters
Exceptions
Returns
stringMessage sucessfully if can blocked an user | Message with error in json format
Make channel's fan one user
addUserChannelFan(\Ant\ChateaClient\Client\number $channel_id, \Ant\ChateaClient\Client\number $user_id) : string
| example |
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 |
Parameters
Exceptions
Returns
stringMassage ok if user is new fan
Add new profile one user
addUserProfile(\Ant\ChateaClient\Client\number $user_id, string $about, string $seeking, $gender, $youWant, $birthday) : array | string
| example |
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",
); |
Parameters
$about
stringShort description your profile
$seeking
stringChoice between
$gender
$youWant
$birthday
Exceptions
Returns
arraystringAssociative array with profile data | Message with error in json format
Report a user
addUserReports(\Ant\ChateaClient\Client\number $user_reported_id, string $reason) : array | string
Parameters
$reason
stringDescription for report the user
Exceptions
Returns
arraystringAssociative array with report data | Message with error in json format
Change user password
changePassword(string $current_password, string $new_password, string $repeat_new_password) : string
| example |
//ouput message
Password changed sucessfully |
Parameters
$current_password
stringyour actual password
$new_password
stringyour new password
$repeat_new_password
stringrepeat your new password
Exceptions
Returns
stringmessage password changed sucessfully if your password have been changed | Message with error in json format
Delete one album
delAlbum(\Ant\ChateaClient\Client\number $user_id, \Ant\ChateaClient\Client\number $album_id) : string
| example |
an abum 1 to user 1
$your_api_instance->delAlbum(1,1);
// ouput message
Album deleted |
Parameters
Exceptions
Returns
stringMessage sucessfully if can delete the album | Message with error in json format
Delete channel
delChannel(\Ant\ChateaClient\Client\number $channel_id) : string
| example |
Ouput this message:
Channel deleted |
Parameters
Exceptions
Returns
stringThe message ok, if channel has been deleted
Delete friends between two users
delFriend(\Ant\ChateaClient\Client\number $user_id, \Ant\ChateaClient\Client\number $user_delete_id) : string
| example |
delete friendship to user 3
$your_api_instance->delFriend(1,3);
Friendship deleted |
Parameters
Exceptions
Returns
stringMessage delete | Message with error in json format
Decline a friendship request
delFriendshipRequest(\Ant\ChateaClient\Client\number $user_id, \Ant\ChateaClient\Client\number $user_decline_id) : string
| example |
declined like new Friend to user 3
$your_api_instance->delFriendshipRequest(1,3);
Friendship declined |
Parameters
Exceptions
Returns
stringMessage declined | Message with error in json format
Delete my user
delMe() : string
| example |
me user
$your_api_instance->delMe();
//ouput message
User deleted |
Exceptions
Returns
stringMessage deleted user | Message with error in json format
Delete a Photo
delPhoto(\Ant\ChateaClient\Client\number $photo_id) : string
| example |
Photo
$your_api_instance->delPhoto(1);
Photo deleted |
Parameters
Exceptions
Returns
stringMessage sucessfully if can delete the photo | Message with error in json format
Delete a photo of album
delPhotoAlbum(\Ant\ChateaClient\Client\number $user_id, \Ant\ChateaClient\Client\number $photo_id) : string
| example |
an abum 1 to user 1
$your_api_instance->delAlbum(1,1);
Photo deleted of Album |
Parameters
Exceptions
Returns
stringMessage sucessfully if can delete photo of album | Message with error in json format
Delete one vote of one photo
delPhotoVote(\Ant\ChateaClient\Client\number $user_id, \Ant\ChateaClient\Client\number $photo_id) : string
| example |
one vote of photo 6
$your_api_instance->delPhotoVote(1,6);
//output
Vote deleted |
Parameters
Exceptions
Returns
stringMessage sucessfully if can delete the vote | Message with error in json format
Delete one thread ant all messages
delThread(\Ant\ChateaClient\Client\number $user_id, \Ant\ChateaClient\Client\number $thread_id) : string
| example |
thread 6
$your_api_instance->delThread(6);
//ouput message
Thread deleted |
Parameters
Exceptions
Returns
stringMessage sucessfully if can delete thread | Message with error in json format
UnBlocked one user
delUserBlocked(\Ant\ChateaClient\Client\number $user_id, \Ant\ChateaClient\Client\number $user_blocked_id) : string
| example |
one user
$your_api_instance->delUserBlocked(1,6);
//output
User unblocked |
Parameters
Exceptions
Returns
stringMessage sucessfully if can blocked an user | Message with error in json format
Remove channel's fan one user
delUserChannelFan(\Ant\ChateaClient\Client\number $channel_id, \Ant\ChateaClient\Client\number $user_id) : string
| example |
the user 1 fan of channel 1
$your_api_instance->delUserChannelFan(1,1);
The ouput message:
The user has been removed as fan of the channel successfully |
Parameters
Exceptions
Returns
stringMassage ok if user is not fan
Request reset the user password. The server send email with new password,
this this request is only once for day.
forgotPassword(string $username_or_email) : string
| example |
$your_api_instance->forgotPassword('you_email@antwebs.es');
Ouput |
Parameters
$username_or_email
stringThe user email or username
Exceptions
Returns
stringmessage ok message if your new password have been sent
Revokes the access token and logout the user session in server.
logout() : string
Exceptions
Returns
stringa message ok and the HTTP status code 200
Get my user
me()
| example |
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",
)
)
); |
Exceptions
Register new user at server
register(string $username, string $email, string $new_password, string $repeat_new_password, string $affiliate_host, $ip) : array | string
| example |
user name','new_password','repeat_new_password','your hosts name');
Ouput
array{
"id"=> 1234,
"username"=> "new-username",
"email"=> "newUserName@ant.com"
} |
Parameters
$username
stringThe name of user. This is unique for user
$email
stringThe email for user. This is unique for user
$new_password
stringThe user password
$repeat_new_password
stringRepeat the password
$affiliate_host
stringThe name of your server, where you make send request.
You don't use protocols (http:// or ftp ) or subdomains only use primary name
$ip
Exceptions
Returns
arraystringAssociative array with you profile | Message with error in json format
Show one album of user
showAlbum(\Ant\ChateaClient\Client\number $user_id, \Ant\ChateaClient\Client\number $album_id) : array | string
| example |
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/app_dev.php/api/users/1/albums/1",
),
"participant" => array(
"href" => "http://api.chatsfree.net/app_dev.php/api/users/1",
),
"photos" => array(
"href" => "http://api.chatsfree.net/app_dev.php/api/albums/1/photos",
)
)
); |
Parameters
Exceptions
Returns
arraystringAssociative array with the album one user | Message with error in json format
Show all abums one user
showAlbums(\Ant\ChateaClient\Client\number $user_id, int $limit, int $offset) : array | string
| example |
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/app_dev.php/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/app_dev.php/api/users/1/albums/1",
),
"participant" => array(
"href" => "http://api.chatsfree.net/app_dev.php/api/users/1",
),
"photos" => array(
"href" => "http://api.chatsfree.net/app_dev.php/api/albums/1/photos",
)
)
)
)
); |
Parameters
$limit
intnumber of items to retrieve at most
$offset
intThe distance (displacement) from the start of a data
Exceptions
Returns
arraystringAssociative array with all albums one user | Message with error in json format
Get channel. Show data channel by id
showChannel(\Ant\ChateaClient\Client\number $channel_id) : array | string
| example |
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"
)
)
); |
Parameters
Exceptions
Returns
arraystringAssociative array with channel data | Message with error in json format
Get fans (users) the channel
showChannelFans(\Ant\ChateaClient\Client\number $channel_id, int $limit, int $offset) : array | string
| example |
Channels Fans of channel 2, only the first
$your_api_instance->showChannelFans(3,1,0);
Sample Ouput
array(
"total" => 2,
"limit" => 2,
"offset" => 0,
"_links" => array(
"self" => array(
"href" => "http://api.chateagratis.net/api/channels/2/fans"
)
),
"resources" => array(
array( "id" => 1,
"username" => "alex",
"email" => "alex@chateagratis.net",
"_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"
)
)
)
)
); |
Parameters
$limit
intnumber of items to retrieve at most
$offset
intThe distance (displacement) from the start of a data
Exceptions
Returns
arraystringAssociative array with users that are fans a channel | Message with error in json format
List all channels register in Server
showChannels(int $limit, int $offset, array $filter) : array | string
| example |
first twenty channels what type is love
$your_api_instance->showChannels(25,0, array('channelType'=>'love'));
Sample Ouput
array(
"id"=>11,
"name" => "channel 11",
"slug" => "channel-11",
"owner"=>array(
id: 1
username: alex
),
"channel_type" => array(
"name" => "default"
),
"_links" => array(
"self" => array(
href => "http://api.chateagratis.net/api/channels/11"
),
"fans" => array(
"href" => "http://api.chateagratis.net/api/channels/11/fans"
),
"owner" => array(
"href => http://api.chateagratis.net/api/users/1"
)
); |
Parameters
$limit
intnumber of items to retrieve at most
$offset
intThe distance (displacement) from the start of a data
$filter
arrayAssociative array with format filter_name =>value_name
Exceptions
Returns
arraystringAssociative array with channels data | Message with error in json format
Get Channles types
showChannelsTypes(int $limit, int $offset) : array | string
| example |
Channels types, only the first
$your_api_instance->showChannelsTypes(1,0);
Sample Ouput
array(
"total" => 6,
"limit" => 1,
"offset" => 0,
"_links" => array(
"self" => array(
"href" => "http://api.chateagratis.net/api/channelstype"
),
),
"resources" => array(
array(
"name" => "adult",
"_links" => array(
"channelsType" => array(
"href" => "http://api.chateagratis.net/api/channels?filter%3DchannelType=adult",
)
)
)
)
); |
Parameters
$limit
intnumber of items to retrieve at most
$offset
intThe distance (displacement) from the start of a data
Exceptions
Returns
arraystringAssociative array with channels types use one channel | Message with error in json format
Get me friends
showFriends(\Ant\ChateaClient\Client\number $user_id, int $limit, int $offset) : array | string
| example |
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",
),
),
),
)
); |
Parameters
$limit
intnumber of items to retrieve at most
$offset
intThe distance (displacement) from the start of a data
Exceptions
Returns
arraystringAssociative array with users's are friends one user | Message with error in json format
Show list user, that one user will pending have your friendship
showFriendshipsPending(\Ant\ChateaClient\Client\number $user_id, int $limit, int $offset) : array | string
| example |
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",
),
)
)
)
); |
Parameters
$limit
intnumber of items to retrieve at most
$offset
intThe distance (displacement) from the start of a data
Exceptions
Returns
arraystringAssociative array with users's are friends one user | Message with error in json format
Show the friendship requests sent by user id, and it pending to be accepted
showFriendshipsRequest(\Ant\ChateaClient\Client\number $user_id, int $limit, int $offset) : array | string
| example |
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",
),
)
)
)
); |
Parameters
$limit
intnumber of items to retrieve at most
$offset
intThe distance (displacement) from the start of a data
Exceptions
Returns
arraystringAssociative array with users's are friends one user | Message with error in json format
Show Photo
showPhoto(string $photo_id) : array | string
| example |
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",
),
)
); |
Parameters
$photo_id
stringThe photo ID that you to retrieve data
Exceptions
Returns
arraystringAssociative array with photo data | Message with error in json format
List all photos of an album
showPhotoAlbum(string $album_id, int $limit, int $offset) : array | string
| example |
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",
),
),
),
)
); |
Parameters
$album_id
stringThe photo album ID that you to retrieve data
$limit
intnumber of items to retrieve at most
$offset
intThe distance (displacement) from the start of a data
Exceptions
Returns
arraystringAssociative array with photos an album | Message with error in json format
Show score I had put to one photo
showPhotoVotes(\Ant\ChateaClient\Client\number $user_id, \Ant\ChateaClient\Client\number $photo_id) : array | string
| example |
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",
)
)
); |
Parameters
Exceptions
Returns
arraystringAssociative array with photos an album | Message with error in json format
Shows the details of a report
showReport(\Ant\ChateaClient\Client\number $report_id) : array | string
| example |
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/app_dev.php/api/reports/1",
),
"reporter" => array(
"href" => "http://api.chatsfree.net/app_dev.php/api/users/1",
),
"resource" => array(
"href" => "http://api.chatsfree.net/app_dev.php/api/users/2",
)
)
); |
Parameters
Exceptions
Returns
arraystringAssociative array with all albums one user | Message with error in json format
Show all reports
showReports(int $limit, int $offset) : array | string
| example |
all reports, only 1rst
$your_api_instance->showReports();
array(
"total" => 42,
"limit" => 1,
"offset" => 0,
"_links" => array(
"self" => array(
"href" => "http://api.chatsfree.net/app_dev.php/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/app_dev.php/api/reports/1",
),
"reporter" => array(
"href" => "http://api.chatsfree.net/app_dev.php/api/users/1",
),
"resource" => array(
"href" => "http://api.chatsfree.net/app_dev.php/api/users/2",
)
)
)
)
); |
Parameters
$limit
intnumber of items to retrieve at most
$offset
intThe distance (displacement) from the start of a data
Exceptions
Returns
arraystringAssociative array with all albums one user | Message with error in json format
List all message one thread
showThreadMessages(\Ant\ChateaClient\Client\number $user_id, \Ant\ChateaClient\Client\number $thread_id) : array | string
| example |
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",
)
); |
Parameters
Exceptions
Returns
arraystringAssociative array with messages | Message with error in json format
Show user messages have in inbox
showThreadsInbox(\Ant\ChateaClient\Client\number $user_id) : array | string
| example |
messages inbox
$your_api_instance->addThread(1);
array(
array(
"id" => 1,
"subject" => "hola thread 1",
),
array(
"id" => 4,
"subject" => "hola thread 4",
)
); |
Parameters
Exceptions
Returns
arraystringAssociative array with the subject | Message with error in json format
Show all thread that you sent
showThreadsSent(\Ant\ChateaClient\Client\number $user_id) : array | string
| example |
messages sent
$your_api_instance->showThreadsSent(1);
array(
array(
"id" => 1,
"subject" => "thread sent 1",
),
array(
"id" => 4,
"subject" => "thread sent 2",
)
); |
Parameters
Exceptions
Returns
arraystringAssociative array with the subject | Message with error in json format
Show user by ID
showUser(\Ant\ChateaClient\Client\number $user_id) : array | string
| example |
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/app_dev.php/api/users/1",
),
"channels" => array(
"href" => "http://api.chatsfree.net/app_dev.php/api/users/1/channels",
),
"channels_fan" => array(
"href" => "http://api.chatsfree.net/app_dev.php/api/users/1/channelsFan",
),
"blocked_users" => array(
"href" => "http://api.chatsfree.net/app_dev.php/api/users/1/blocked",
)
)
); |
Parameters
Exceptions
Returns
arraystringAssociative array with user data | Message with error in json format
Show channels created for the user
showUserChannels(\Ant\ChateaClient\Client\number $user_id, int $limit, int $offset) : array | string
| example |
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",
),
)
)
)
); |
Parameters
$limit
intnumber of items to retrieve at most
$offset
intThe distance (displacement) from the start of a data
Exceptions
Returns
arraystringAssociative array with channels created one user | Message with error in json format
Show channels favorites one user
showUserChannelsFan(\Ant\ChateaClient\Client\number $user_id, int $limit, int $offset) : array | string
| example |
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"
)
)
)
)
); |
Parameters
$limit
intnumber of items to retrieve at most
$offset
intThe distance (displacement) from the start of a data
Exceptions
Returns
arraystringAssociative array with channel's is fan one user | Message with error in json format
Show all votes of one user
showUserPhotoVotes(\Ant\ChateaClient\Client\number $user_id, int $limit, int $offset) : array | string
| example |
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/app_dev.php/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/app_dev.php/api/users/1/photos/2/votes",
),
"photo" => array(
"href" => "http://api.chatsfree.net/app_dev.php/api/photos/2",
),
"participant" => array(
"href" => "http://api.chatsfree.net/app_dev.php/api/users/1",
)
)
)
)
); |
Parameters
$limit
intnumber of items to retrieve at most
$offset
intThe distance (displacement) from the start of a data
Exceptions
Returns
arraystringAssociative array with all votes one user | Message with error in json format
Show all photos one user
showUserPhotos(\Ant\ChateaClient\Client\number $user_id, int $limit, int $offset) : array | string
| example |
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",
)
)
)
); |
Parameters
$limit
intnumber of items to retrieve at most
$offset
intThe distance (displacement) from the start of a data
Exceptions
Returns
arraystringAssociative array with photos an album | Message with error in json format
Show profile by user ID
showUserProfile(\Ant\ChateaClient\Client\number $user_id) : array | string
| example |
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",
); |
Parameters
Exceptions
Returns
arraystringAssociative array with profile data | Message with error in json format
Show count visits on one profile and who visits of one profile
showUserVisitors(\Ant\ChateaClient\Client\number $user_id, int $limit, int $offset) : array | string
Parameters
$limit
intnumber of items to retrieve at most
$offset
intThe distance (displacement) from the start of a data
Exceptions
Returns
arraystring
Get all the users
showUsers(int $limit, int $offset) : array | string
| example |
all users, only first
$your_api_instance->showUsers();
array(
"total" => 12,
"limit" => 1,
"offset" => 0,
"_links" => array(
"self" => array(
"href" => "http://api.chatsfree.net/app_dev.php/api/users",
)
),
"resources" => array(
array(
"id" => 1,
"username" => "alex",
"email" => "alex@chateagratis.net",
"_links" => array(
"self" => array(
"href" => "http://api.chatsfree.net/app_dev.php/api/users/1",
),
"channels" => array(
"href" => "http://api.chatsfree.net/app_dev.php/api/users/1/channels",
),
"channels_fan" => array(
"href" => "http://api.chatsfree.net/app_dev.php/api/users/1/channelsFan",
),
"blocked_users" => array(
"href" => "http://api.chatsfree.net/app_dev.php/api/users/1/blocked",
)
)
)
)
); |
Parameters
$limit
intnumber of items to retrieve at most
$offset
intThe distance (displacement) from the start of a data
Exceptions
Returns
arraystringAssociative array with all users | Message with error in json format
Show user blocked by ID user
showUsersBlocked(\Ant\ChateaClient\Client\number $user_id, int $limit, int $offset) : array | string
| example |
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/app_dev.php/api/users",
)
),
"resources" => array(
array(
"id" => 2,
"username" => "alex2",
"email" => "alex2@chateagratis.net",
"_links" => array(
"self" => array(
"href" => "http://api.chatsfree.net/app_dev.php/api/users/2",
),
"channels" => array(
"href" => "http://api.chatsfree.net/app_dev.php/api/users/2/channels",
),
"channels_fan" => array(
"href" => "http://api.chatsfree.net/app_dev.php/api/users/2/channelsFan",
),
"blocked_users" => array(
"href" => "http://api.chatsfree.net/app_dev.php/api/users/2/blocked",
)
)
)
)
); |
Parameters
$limit
intnumber of items to retrieve at most
$offset
intThe distance (displacement) from the start of a data
Exceptions
Returns
arraystringAssociative array with all users blocked | Message with error in json format
Update a channel
updateChannel(\Ant\ChateaClient\Client\number $channel_id, string $name, string $title, string $description, string $channel_type) : array | string
| example |
'update channel name','API - Channel title',
'This is channel about loves, friends and others', 'love');
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"
)
)
); |
Parameters
$name
stringThe new name of channel, if you would like update this field.
$title
stringThe new title of channel, if you would like update this field.
$description
stringThe new description, of channel if you would like update this field.
$channel_type
stringThe type, of channel if you would like update this field.
Exceptions
Returns
arraystringAssociative array with updated channel | Message with error in json format
Update a profile of me user
updateMe(string $username, string $email, string $current_password) : array | string
| example |
array(
'id' => '1',
'username' => 'xabier',
'email' => 'xabier@antweb.es',
); |
Parameters
$username
stringyour user name | the new username
$email
stringyour email | the new user email
$current_password
stringyour password. This method can not change your password for this use @link #changePassword
Exceptions
Returns
arraystringAssociative array with you profile updated | Message with error in json format
Update user profile
updateUserProfile(\Ant\ChateaClient\Client\number $user_id, string $about, string $seeking) : array | string
| example |
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",
); |
Parameters
$about
stringShort description your profile
$seeking
stringChoice between
Exceptions
Returns
arraystringAssociative array with profile data | Message with error in json format