Response
{
"status": "success",
"data": [
{
"is_liked": "12",
"user_id": "1",
"page_id": "12",
"view_id": "0",
"title": "House Tarly",
"reg_method": "0",
"is_featured": "0",
"is_sponsor": "0",
"total_like": "1",
"total_comment": "0",
"privacy": "0",
"item_type": "1",
"link": "http://example.com/groups/12/",
"category": {
"type_id": "6",
"name": "sports",
"link": "http://example.com/groups/category/6/sports/"
},
"location": null,
"cover": null,
"avatar": null,
"sub_category": {
"category_id": "160",
"name": "groups_category_401b3ebc575df4e3d3a7e78b8dd67150",
"link": "http://example.com/groups/sub-category/160/badminton/"
},
"info": null
}
],
"message": "",
"error": null
}
POST /groups
Create group
Example URI
http://example.com/restful_api/groups
Parameters
| Parameter | Type | Require ? | Description |
|---|---|---|---|
| val[title] | String | Yes | Group title |
| val[type_id] | Integer | Yes | Category of group |
| val[category_id] | Integer | No | Subcategory that group belonging to (Subcategory must be children of Category) |
| val[reg_method] | Integer | Yes | Group type privacy, available options: 0, 1, 2 |
Response
{
"status": "success",
"data": {
"page_id": "13",
"view_id": "0",
"user_id": "1",
"title": "House Mormont",
"reg_method": "0",
"is_featured": "0",
"is_sponsor": "0",
"total_like": "1",
"total_comment": "0",
"privacy": "0",
"item_type": "1",
"is_liked": true,
"link": "http://example.com/groups/13/",
"category": {
"type_id": "6",
"name": "sports",
"link": "http://example.com/groups/category/6/sports/"
},
"location": null,
"cover": null,
"avatar": null,
"sub_category": {
"category_id": "159",
"name": "groups_category_2ea8140004527d6af669a76b8dcefc19",
"link": "http://example.com/groups/category/6/football/"
},
"info": null
},
"message": "Group successfully added.",
"error": null
}
GET /groups/:id
get group's details
Example URI
http://example.com/restful_api/groups/13
Parameters
| Parameter | Type | Require ? | Description |
|---|---|---|---|
| id | Integer | Yes | Group id |
Response
{
"status": "success",
"data": {
"page_id": "13",
"view_id": "0",
"user_id": "1",
"title": "House Mormont",
"reg_method": "0",
"is_featured": "0",
"is_sponsor": "0",
"total_like": "1",
"total_comment": "0",
"privacy": "0",
"item_type": "1",
"is_liked": true,
"link": "http://example.com/groups/13/",
"category": {
"type_id": "6",
"name": "sports",
"link": "http://example.com/groups/category/6/sports/"
},
"location": null,
"cover": null,
"avatar": null,
"sub_category": {
"category_id": "159",
"name": "groups_category_2ea8140004527d6af669a76b8dcefc19",
"link": "http://example.com/groups/category/6/football/"
},
"info": null
},
"message": "",
"error": null
}
PUT /groups/:id
update a group
Example URI
http://example.com/restful_api/groups/13
Parameters
| Parameter | Type | Require ? | Description |
|---|---|---|---|
| val[title] | String | Yes | Group Title |
| val[type_id] | Integer | Yes | Category that group belonging to |
| val[category_id] | Integer | No | Subcategory that group belonging to (Subcategory must be children of Category) |
| val[reg_method] | Integer | No | Group type privacy, available options: 0, 1, 2 |
| val[location] | String | No | Location name of group |
| val[location_lat] | Float | No | Location latitude of group |
| val[location_lng] | Float | No | Location longitude of group |
| val[temp_file] | Integer | No | Id of the temporary image that is storage in table temp_file, this file will be set as Avatar of Group |
| val[remove_photo] | Integer | No | Value is 1 or 0, set 1 to remove the current avatar of group |
| val[text] | String | No | Info of group |
| val[invite] | Array | No | An array of user_id is invited to like group. Example: [ 1, 2 ] |
| val[phones] | String | No | A list of phones number is invited to like group. Example: +84932127567,+84932127568 |
| val[emails] | String | No | A list of emails is invited to like group. Example: email1@gmail.com,email2@gmail.com |
| val[admins] | Array | No | An array of user_id is set as admin of group. Example: [ 1, 2 ] |
| val[perms][perm_name] | Array | No | List permissions of group, "perm_name" is the var name of permission. Example: val[perms][blog.share_blogs] = 0 ( 0: Anyone, 1: Members Only, 2: Admins Only) |
| val[vanity_url] | String | No | Vanity url of group |
Response
{
"status": "success",
"data": {
"page_id": "13",
"view_id": "0",
"user_id": "1",
"title": "House Mormont of Bear Island",
"reg_method": "1",
"is_featured": "0",
"is_sponsor": "0",
"total_like": "1",
"total_comment": "0",
"privacy": "0",
"item_type": "1",
"is_liked": true,
"link": "http://example.com/groups/13/",
"category": {
"type_id": "6",
"name": "sports",
"link": "http://example.com/groups/category/6/sports/"
},
"location": null,
"cover": null,
"avatar": null,
"info": "Later ruled by Lyanna Mormont"
},
"message": "Group successfully updated.",
"error": null
}
DELETE /groups/:id
Delete a group
Example URI
http://example.com/restful_api/groups/13
Parameter
| Parameter | Type | Require ? | Description |
|---|---|---|---|
| id | Integer | Yes | Group Id |
Response
{
"status": "success",
"data": [],
"message": "Group successfully deleted.",
"error": null
}