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

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 14 Next »

GET /event

Browse events

Example URI

 http://example.com/restful_api/event?search[search]=christmas&when=this-month

Parameters

Parameter

Type

Require ?

Description

searchsearch

string

no

Keyword for searching

user_id

string

no

Browse by owner id

sort

string

no

Support sort return results, available options: latest, most-liked, most-talked

when

string

no

Browse events by start time, available options: all-time, this-month, this-week, today, upcoming, ongoing

limit

number

no

Limit return results

page

number

no

Paging return results

item_id

number

no

Support browse events on item (pages/groups)

module_id

string

no

Support search events on item (pages/groups)

category

number

no

Support search events by category id

view

string

no

Support some view mode: featured, pending, my, attending, may-attend, not-attending, invites

Response

{
  "status": "success",
  "data": [
    {
      "rsvp_id": "1",
      "event_id": "1",
      "view_id": "0",
      "is_featured": "0",
      "is_sponsor": "0",
      "privacy": "0",
      "privacy_comment": "0",
      "module_id": "event",
      "item_id": "0",
      "user_id": "1",
      "title": "Christmas Party",
      "location": "New York",
      "country_iso": "US",
      "country_child_id": "6",
      "postal_code": null,
      "city": null,
      "time_stamp": "1481856813",
      "start_time": "1482598800",
      "end_time": "1482618600",
      "image_path": null,
      "server_id": "0",
      "total_comment": "0",
      "total_like": "0",
      "gmap": null,
      "address": null,
      "description": "Celebrate Christmas 2016 and welcome New Year 2017!!!",
      "event_date": "Saturday, December 24, 2016 6:00 pm - 11:30 pm",
      "categories": [
        [
          "Party",
          "http://example.com/event/category/2/party/"
        ]
      ]
    }
  ],
  "messages": []
}

POST /event

Post new event

Example URI

 http://example.com/restful_api/event

Parameters

Parameter

Type

Require ?

Description

val[category]

id

no

Event category id

val[title]

string

yes

Event title

val[description]

string

no

Event description

val[start_hour]

number

yes

Start hour

val[start_minute]

number

yes

Start minute

val[start_month]

number

yes

Start month

val[start_year]

number

yes

Start year

val[start_day]

number

yes

Start day

val[end_hour]

number

yes

End hour

val[end_minute]

number

yes

End minute

val[end_day]

number

yes

End day

val[end_month]

number

yes

End month

val[end_year]

number

yes

End year

val[location]

string

yes

Event location

val[address]

string

no

Address

val[city]

string

no

City

val[postal_code]

string

no

Postal Code

val[country_iso]

string

no

Country ISO

val[country_child_id]

number

no

State id/ Province id

val[privacy]

number

yes

Event privacy

val[privacy_comment]

number

yes

Share provicy

val[module_id]

string

no

parent module id, support post event on item (groups, pages...)

val[item_id]

number

no

parent item id, support post event on item (groups, pages...)

Response

{
  "status": "success",
  "data": {
    "rsvp_id": "1",
    "event_id": "3",
    "view_id": "0",
    "is_featured": "0",
    "is_sponsor": "0",
    "privacy": "1",
    "privacy_comment": "1",
    "module_id": "pages",
    "item_id": "2",
    "user_id": "1",
    "title": "December Offline (Year End party)",
    "location": "Lotus Restaurent",
    "country_iso": "US",
    "country_child_id": "0",
    "postal_code": null,
    "city": null,
    "time_stamp": "1481858333",
    "start_time": "1483075800",
    "end_time": "1483137000",
    "image_path": null,
    "server_id": "0",
    "total_comment": "0",
    "total_like": "0",
    "gmap": null,
    "address": null,
    "description": "Year End party",
    "event_date": "Friday, December 30, 2016 6:30 am - 11:30 pm",
    "categories": [
      [
        "Sports",
        "http://example.com/event/category/4/sports/"
      ]
    ]
  },
  "messages": [
    "Event successfully added."
  ]
}

GET /event/:id

Get information of a specific event

Example URI

 http://example.com/restful_api/event/1

Parameters

Parameter

Type

Require ?

Description

id

number

yes

Event id

Response

{
  "status": "success",
  "data": {
    "rsvp_id": "1",
    "event_id": "1",
    "view_id": "0",
    "is_featured": "0",
    "is_sponsor": "0",
    "privacy": "0",
    "privacy_comment": "0",
    "module_id": "event",
    "item_id": "0",
    "user_id": "1",
    "title": "Christmas Party",
    "location": "New York",
    "country_iso": "US",
    "country_child_id": "6",
    "postal_code": null,
    "city": null,
    "time_stamp": "1481856813",
    "start_time": "1482598800",
    "end_time": "1482618600",
    "image_path": null,
    "server_id": "0",
    "total_comment": "0",
    "total_like": "0",
    "gmap": null,
    "address": null,
    "description": "Celebrate Christmas 2016 and welcome New Year 2017!!!",
    "event_date": "Saturday, December 24, 2016 6:00 pm - 11:30 pm",
    "categories": [
      [
        "Party",
        "http://example.com/event/category/2/party/"
      ]
    ]
  },
  "messages": []
}

PUT /event/:id

Update information for a specific event

Example URI

 http://example.com/restful_api/event/1

Parameters

Parameter

Type

Require ?

Description

id

number

yes

Event id

val[category]

number

no

Event category id

val[title]

string

no

Event title

val[description]

string

no

Event description

val[start_hour]

number

no

Start hour

val[start_minute]

number

no

Start minute

val[start_month]

number

no

Start month

val[start_year]

number

no

Start year

val[start_day]

number

no

Start day

val[end_hour]

number

no

End hour

val[end_minute]

number

no

End minute

val[end_day]

number

no

End day

val[end_month]

number

no

End month

val[end_year]

number

no

End year

val[location]

string

bo

Event location

val[address]

string

no

Address

val[city]

string

no

City

val[postal_code]

string

no

Postal Code

val[country_iso]

string

no

Country ISO

val[country_child_id]

number

no

State id/ Province id

val[privacy]

number

no

Event privacy

val[privacy_comment]

number

no

Share provicy

val[invite][]

array

no

Friend id list to invite

val[personal_message]

number

no

Invite message

val[emails]

string

no

Email list to invite

val[delete_image]

boolean

no

Remove event photo

image

file

no

Upload event photo

Response

{
  "status": "success",
  "data": {
    "rsvp_id": "1",
    "event_id": "1",
    "view_id": "0",
    "is_featured": "0",
    "is_sponsor": "0",
    "privacy": "0",
    "privacy_comment": "0",
    "module_id": "event",
    "item_id": "0",
    "user_id": "1",
    "title": "Christmas Party",
    "location": "New York",
    "country_iso": "US",
    "country_child_id": "6",
    "postal_code": null,
    "city": null,
    "time_stamp": "1481856813",
    "start_time": "1482598800",
    "end_time": "1482618600",
    "image_path": null,
    "server_id": "0",
    "total_comment": "0",
    "total_like": "0",
    "gmap": null,
    "address": null,
    "description": "Celebrate Christmas 2016 and welcome New Year 2017!!!",
    "event_date": "Saturday, December 24, 2016 6:00 pm - 11:30 pm",
    "categories": null
  },
  "messages": [
    "Event successfully updated."
  ]
}

DELETE /event/:id

Delete a specific event

Example URI

 http://example.com/restful_api/event/1

Parameters

Parameter

Type

Require ?

Description

id

number

yes

Event id

Response

{
  "status": "success",
  "data": [],
  "messages": [
    "Event successfully deleted."
  ]
}

PUT /event/:id/rsvp

Update RSVP on a specific event

Example URI

 http://example.com/restful_api/event/1/rsvp

Parameters

Parameter

Type

Require ?

Description

id

number

yes

Event id

rsvp

number

yes

RSVP id, available values: 1(attending), 2(may be attending), 3(not attending)

Response

{
  "status": "success",
  "data": [],
  "messages": [
    "RSVP successfully updated."
  ]
}

GET /event/:id/guests

Get guests list of a specific event

Example URI

 http://example.com/restful_api/event/1/guests

Parameters

Parameter

Type

Require ?

Description

id

number

yes

Event id

rsvp

number

no

RSVP id (default is 1 - attending)

limit

number

no

Limit return results

page

number

no

Paging return results

Response

{
  "status": "success",
  "data": [
    {
      "invite_id": "1",
      "event_id": "1",
      "rsvp_id": "1",
      "user_id": "1",
      "time_stamp": "1481859987",
      "user_name": "admin",
      "full_name": "Admin"
    }
  ],
  "messages": []
}
  • No labels