Overview
In general this will update the SDK to version 1.1 being compatible with the Tapglue API 0.4.
- UGC API with Posts, Comments & Likes
- New Feed API with Newsfeed, Posts Feed & Events Feed
- New Connections API with Friends Confirmation
- Multi-User Search (by Email & SocialIds)
- Queries for all Feeds
- Add tests for new methods
- Add new functions to sample app (posts & comments only)
As in the project before. The iOS SDK is the template/blueprint for the Implementation if the following document is missing specification details. The documentation regarding the iOS details can be found here.
New models
The new models for this API version contain:
The specification and attributes of the new entities are below.
New Endpoints
The endpoints that are currently missing are specified in this document. This document the most important in this specification as it shows all the gaps and differences in the current Android SDK.
Naming inconsistencies are also marked (red) in that document. They should be aligned with the iOS SDK API, wherever reasonable.
Basic
This section describes the basic changes that need to be done.
Version
User
Event
Restructuring
Connections
Posts, Comments & Likes API
We've added a new API for Posts, Comments on Posts and Likes on Posts and Shares of Posts.
The API now allows the creation of posts. Posts support the basic CRUD as well as retrieving a list of posts for different endpoints.
Methods
Following methods should be available after the implementation of the Posts API.
Posts
Comments
Likes
Model
The following section describes the models for Posts, Comments and Likes.
Posts
Write
| Key |
Type |
Description |
Example |
| tags |
array |
Contains an array of strings which describe tags of a post |
"tags": ["fitness","running"] |
| visibility |
int |
Visibility of posts (10,20,30) |
"visibility": 30 |
| attachments |
array |
Contains various attachments of a post (text, url) |
example below |
Attachments example
"attachments": [
{
"content": "http://bit.ly/123gif",
"name": "teaser",
"type": "url"
},
{
"content": "Lorem ipsum...",
"name": "body",
"type": "text
}
],
"tags": [
"review"
]
The attachment structure is always the same:
currently we support text and url as the type. In the future we will allow more types such as audio, video, image etc. In this case content will always be a url.
Read only
| Key |
Type |
Description |
Example |
| id |
string |
Id of the post |
"id": "12743631303647839" |
| user_id |
string |
Id of the user who created post |
"user_id": "11286878691041887" |
| is_liked |
bool |
Flag wether the posts is liked or not |
"is_liked": true |
| created_at |
string |
Created at date |
"created_at": "2015-11-27T16:03:36.171840385Z" |
| updated_at |
string |
Created at date |
"updated_at": "2015-11-27T16:03:36.171840478Z |
The user of the post should be accessible like in events Post.user.username etc.
Addition read only keys for counts are:
"counts": {
"comments": 3,
"likes": 12,
"shares": 1
}
We don't return the counts yet. So the values should just be 0 if nothing is being returned from the API. However we will soon enable this feature from our backend
Comments
Write
| Key |
Type |
Description |
Example |
| content |
string |
Content of the comment |
"content": "very nice post!" |
Read only
| Key |
Type |
Description |
Example |
| id |
string |
Id of the like |
"id": "12743631303647840" |
| post_id |
string |
Id of the post |
"id": "12743631303647839" |
| user_id |
string |
Id of the user who created post |
"user_id": "11286878691041887" |
| created_at |
string |
Created at date |
"created_at": "2015-11-27T16:03:36.171840385Z" |
| updated_at |
string |
Created at date |
"updated_at": "2015-11-27T16:03:36.171840478Z |
Likes
Read only
| Key |
Type |
Description |
Example |
| id |
string |
Id of the comment |
"id": "12743631303647840" |
| post_id |
string |
Id of the post |
"id": "12743631303647839" |
| user_id |
string |
Id of the user who created post |
"user_id": "11286878691041887" |
| created_at |
string |
Created at date |
"created_at": "2015-11-27T16:03:36.171840385Z" |
| updated_at |
string |
Created at date |
"updated_at": "2015-11-27T16:03:36.171840478Z |
API
Overview of endpoints:
| Name |
Method |
Route |
| Create Post |
POST |
/posts |
| Retrieve Post |
GET |
/posts/{postID} |
| Update Post |
PUT |
/posts/{postID} |
| Delete Post |
DELETE |
/posts/{postID} |
| Retrieve all Posts |
GET |
/posts |
| Retrieve Posts Feed |
GET |
/me/feed/posts |
| Retrieve my Posts |
GET |
/me/posts |
| Retrieve users Posts |
GET |
/users/{userID}/posts |
| Name |
Method |
Route |
| Create Comment |
POST |
/posts/{postID}/comments |
| Update Comment |
PUT |
/posts/{postID}/comments/{commentID} |
| Delete Comment |
DELETE |
/posts/{postID}/comments/{commentID} |
| Retrieve Comments |
GET |
/posts/{postID}/comments |
| Name |
Method |
Route |
| Create Like |
POST |
/posts/{postID}/likes |
| Delete Like |
DELETE |
/posts/{postID}/likes |
| Retrieve Likes |
GET |
/posts/{postID}/likes |
Deletion of likes is idempotent, so there is no id needed.
Post creation
curl -X POST /posts \
-d $'
{
"attachments": [
{
"content": "http://bit.ly/123gif",
"name": "teaser",
"type": "url"
},
{
"content": "Lorem ipsum...",
"name": "body",
"type": "text
}
],
"tags": [
"review"
],
"visibility": 30
}
'
201 Created
{
"attachments": [
{
"content": "http://bit.ly/123gif",
"name": "teaser",
"type": "url"
},
{
"content": "Lorem ipsum...",
"name": "body",
"type": "text
}
],
"id": "12743631303647839",
"tags": [
"review"
],
"visibility": 30,
"user_id": "11286878691041887",
"created_at": "2015-11-27T16:03:36.171840385Z",
"updated_at": "2015-11-27T16:03:36.171840478Z"
}
Comment creation
curl -X POST /posts/12743631303647839/comments \
-d $'
{
"content": "Do like.",
}
'
201 Created
{
"content": "Do like.",
"id": "12743631303647840",
"post_id": "12743631303647839",
"user_id": "11286878691041888",
"created_at": "2015-11-27T16:03:36.171840385Z",
"updated_at": "2015-11-27T16:03:36.171840478Z"
}
Comment retrieval
curl -X GET /posts/12743631303647839/comments
200 OK
{
"comments": [
{
"content": "Do like.",
"id": "12743631303647840",
"post_id": "12743631303647839",
"user_id": "11286878691041888",
"created_at": "2015-11-27T16:03:36.171840385Z",
"updated_at": "2015-11-27T16:03:36.171840478Z"
}
],
"comments_count": 1,
"post": {
"attachments": [
{
"content": "http://bit.ly/123gif",
"name": "teaser",
"type": "url"
},
{
"content": "Lorem ipsum...",
"name": "body",
"type": "text
}
],
"id": "12743631303647839",
"tags": [
"review"
],
"visibility": 30,
"user_id": "11286878691041887",
"created_at": "2015-11-27T16:03:36.171840385Z",
"updated_at": "2015-11-27T16:03:36.171840478Z"
}
}
Comment deletion
curl -X DELETE /posts/12743631303647839/comments/12743631303647840
Like creation
curl -X POST /posts/12743631303647839/likes \
-H 'Content-Length: 0'
201 Created
{
"id": "37363583381716140",
"post_id": "12743631303647839",
"user_id": "11286878691041888",
"created_at":"2015-03-21T14:28:02.4+01:00",
"updated_at":"2015-03-21T14:28:02.4+01:00"
}
Like retrieval
curl -X GET /posts/12743631303647839/likes
200 OK
{
"likes": [
{
"id": "37363583381716140",
"post_id": "12743631303647839",
"user_id": "11286878691041888",
"created_at":"2015-03-21T14:28:02.4+01:00",
"updated_at":"2015-03-21T14:28:02.4+01:00"
}
],
"likes_count": 1,
"post": {
"attachments": [
{
"content": "http://bit.ly/123gif",
"name": "teaser",
"type": "url"
},
{
"content": "Lorem ipsum...",
"name": "body",
"type": "text
}
],
"id": "12743631303647839",
"tags": [
"review"
],
"visibility": 30,
"user_id": "11286878691041887",
"created_at": "2015-11-27T16:03:36.171840385Z",
"updated_at": "2015-11-27T16:03:36.171840478Z"
}
}
Like deletion
curl -X DELETE /posts/12743631303647839/likes/37363583381716140
New search methods
We have a new API that allows to search for multiple emails or socialIDs. Examples:
curl -X "GET" "https://api.tapglue.com/0.4/users/search?email=jonelle.bowers%40rccgmail.org&email=nu.cardamone%40mycabin.com" \
-H "Accept: application/json" \
-H "Authorization: Basic OWQ0ZjgzNjNjZTFmZDExMTM4NDUyMmE5NWNkZjZiM2Y6SzJCT2FTRjRJbU1yWVZGaU9pOUlPWDB2VG1ZPQ=="
curl -X "GET" "https://api.tapglue.com/0.4/users/search?social_platform=facebook&socialid=fb54321123&socialid=fb543211234" \
-H "Accept: application/json" \
-H "Authorization: Basic OWQ0ZjgzNjNjZTFmZDExMTM4NDUyMmE5NWNkZjZiM2Y6SzJCT2FTRjRJbU1yWVZGaU9pOUlPWDB2VG1ZPQ=="
The goal is to implement to new methods:
- searchUsersWithEmails (params: emails = [string,string...]
- searchUsersWithSocialIds (params: platform = string socialIds = [string,string,..]
New feed structure
Due to the introduction of posts, the new feed structure changed a little bit.
The new feeds structure will look like the following:
me/feed -> posts & events
me/feed/posts -> posts
me/feed/events -> events
for users
me/events & users/:userID/events
me/posts & users/:userID/posts
The new me/feed will have both posts and events. The other endpoints have either posts or events.
The names of the methods should be as follows:
Feed queries
Besides the default feed() methods above. There should be another additional method that also accepts a query object. The query is a JSON object and need to be attached to endpoint after ?where= clause. Here is an example of a query object:
{
"object":{
"id":{
"eq":"someId"
}
},
"type":{
"eq":"someType"
}
}
The query object always contains the field, that is to be checked (i.e. type) followed by the request condition eq and then the value someType. For now, the only request condition is eq but there are more to come in the future. Fields that are checkable are currently:
- type
- tg_object_id
- object -> id
- object -> type
As a request condition we currently support two:
eq, contains a single string. in contains an array of strings.
Example for in:
{
"type":{
"in":["someType","anotherType"]
}
}
Update tests
Update sample app
Overview
In general this will update the SDK to version 1.1 being compatible with the Tapglue API 0.4.
As in the project before. The iOS SDK is the template/blueprint for the Implementation if the following document is missing specification details. The documentation regarding the iOS details can be found here.
New models
The new models for this API version contain:
The specification and attributes of the new entities are below.
New Endpoints
The endpoints that are currently missing are specified in this document. This document the most important in this specification as it shows all the gaps and differences in the current Android SDK.
Naming inconsistencies are also marked (red) in that document. They should be aligned with the iOS SDK API, wherever reasonable.
Basic
This section describes the basic changes that need to be done.
Version
1.0to1.1.0User
setUnhashedPasswordmethod to user to set a password that is notPBKDF2hashed.Event
tg_object_idto the events model.Restructuring
Tapglue.connections()toTapglue.connection()(singular to be consistent)feed()toconnection():Connections
unFriendtounfriendunFollowtounfollowTapglue.connection().retrieveConfirmedConncetionsForCurrentUserTapglue.connection().retrieveRejectedConncetionsForCurrentUserPosts, Comments & Likes API
We've added a new API for Posts, Comments on Posts and Likes on Posts and Shares of Posts.
The API now allows the creation of posts. Posts support the basic
CRUDas well as retrieving a list of posts for different endpoints.Methods
Following methods should be available after the implementation of the Posts API.
Posts
Comments
Likes
Model
The following section describes the models for Posts, Comments and Likes.
Posts
Write
"tags": ["fitness","running"]"visibility": 30Attachments example
The attachment structure is always the same:
currently we support
textandurlas the type. In the future we will allow more types such as audio, video, image etc. In this case content will always be a url.Read only
"id": "12743631303647839""user_id": "11286878691041887""is_liked": true"created_at": "2015-11-27T16:03:36.171840385Z""updated_at": "2015-11-27T16:03:36.171840478ZThe user of the post should be accessible like in events
Post.user.usernameetc.Addition read only keys for counts are:
We don't return the counts yet. So the values should just be 0 if nothing is being returned from the API. However we will soon enable this feature from our backend
Comments
Write
"content": "very nice post!"Read only
"id": "12743631303647840""id": "12743631303647839""user_id": "11286878691041887""created_at": "2015-11-27T16:03:36.171840385Z""updated_at": "2015-11-27T16:03:36.171840478ZLikes
Read only
"id": "12743631303647840""id": "12743631303647839""user_id": "11286878691041887""created_at": "2015-11-27T16:03:36.171840385Z""updated_at": "2015-11-27T16:03:36.171840478ZAPI
Overview of endpoints:
POST/postsGET/posts/{postID}PUT/posts/{postID}DELETE/posts/{postID}GET/postsGET/me/feed/postsGET/me/postsGET/users/{userID}/postsPOST/posts/{postID}/commentsPUT/posts/{postID}/comments/{commentID}DELETE/posts/{postID}/comments/{commentID}GET/posts/{postID}/commentsPOST/posts/{postID}/likesDELETE/posts/{postID}/likesGET/posts/{postID}/likesDeletion of likes is idempotent, so there is no id needed.
Post creation
Comment creation
Comment retrieval
Comment deletion
Like creation
Like retrieval
Like deletion
New search methods
We have a new API that allows to search for multiple emails or socialIDs. Examples:
Tapglue.user().searchUsersWithEmailsTapglue.user().searchUsersWithSocialUserIdsThe goal is to implement to new methods:
New feed structure
Due to the introduction of posts, the new feed structure changed a little bit.
The new feeds structure will look like the following:
me/feed->posts&eventsme/feed/posts->postsme/feed/events->eventsfor users
me/events&users/:userID/eventsme/posts&users/:userID/postsThe new
me/feedwill have bothpostsandevents. The other endpoints have eitherpostsorevents.The names of the methods should be as follows:
me/feed->Tapglue.feed().retrieveNewsFeedForCurrentUserme/feed/posts->Tapglue.feed().retrievePostsFeedForCurrentUserme/feed/events->Tapglue.feed().retrieveEventsFeedForCurrentUserme/events->Tapglue.feed().retrieveEventsForCurrentUserusers/:userID/events->Tapglue.feed().retrieveEventsForUserme/posts->Tapglue.feed().retrievePostsForCurrentUserusers/:userID/posts->Tapglue.feed().retrievePostsForUserFeed queries
Besides the default
feed()methods above. There should be another additional method that also accepts a query object. The query is a JSON object and need to be attached to endpoint after?where=clause. Here is an example of a query object:{ "object":{ "id":{ "eq":"someId" } }, "type":{ "eq":"someType" } }The query object always contains the field, that is to be checked (i.e. type) followed by the request condition eq and then the value someType. For now, the only request condition is eq but there are more to come in the future. Fields that are checkable are currently:
As a request condition we currently support two:
eq, contains a single string. in contains an array of strings.
Example for in:
{ "type":{ "in":["someType","anotherType"] } }Update tests
Update sample app