Page tree
Skip to end of metadata
Go to start of metadata

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

ParameterTypeRequire ?Description
val[title]StringYesGroup title
val[type_id]IntegerYesCategory of group
val[category_id]IntegerNoSubcategory that group belonging to (Subcategory must be children of Category)
val[reg_method]IntegerYesGroup 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

ParameterTypeRequire ?Description
idIntegerYesGroup 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

ParameterTypeRequire ?Description
val[title]StringYesGroup Title
val[type_id]IntegerYesCategory that group belonging to
val[category_id]IntegerNoSubcategory that group belonging to (Subcategory must be children of Category)
val[reg_method]IntegerNoGroup type privacy, available options: 0, 1, 2
val[location]StringNoLocation name of group
val[location_lat]FloatNoLocation latitude of group
val[location_lng]FloatNoLocation longitude of group
val[temp_file]IntegerNoId of the temporary image that is storage in table temp_file, this file will be set as Avatar of Group
val[remove_photo]IntegerNoValue is 1 or 0, set 1 to remove the current avatar of group
val[text]StringNoInfo of group
val[invite]ArrayNoAn array of user_id is invited to like group. Example: [ 1, 2 ]
val[phones]StringNoA list of phones number is invited to like group. Example: +84932127567,+84932127568
val[emails]StringNoA list of emails is invited to like group. Example: email1@gmail.com,email2@gmail.com
val[admins]ArrayNoAn array of user_id is set as admin of group. Example: [ 1, 2 ]
val[perms][perm_name]ArrayNo

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]StringNoVanity 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

ParameterTypeRequire ?Description
idIntegerYesGroup Id

Response

{
    "status": "success",
    "data": [],
    "message": "Group successfully deleted.",
    "error": null
}
  • No labels