ZhangYiJiang / jublia-agenda

AY16/17 CS3216 final project - 21st century event agenda
https://agenda-demo.jublia.com/
1 stars 1 forks source link

Tag API implementation #26

Closed paradite closed 8 years ago

paradite commented 8 years ago
ZhangYiJiang commented 8 years ago

Refer to http://docs.jubliaagenda.apiary.io/#reference/tags-and-tag-categories/get and http://docs.jubliaagenda.apiary.io/#reference/event-session/agendaidsessions/get for the full documentation

To create tags, use the api/{agenda_id}/categories and api/{agenda_id}/categories/{category_id}/tags endpoints. When creating a category you can specify tags to be created under it by specifying an array of strings under tags like

{
    "name": "New Category", 
    "tags": ["Tag A", "Tag B", "Tag C"]
}

Tags under a session object is specified using the categories key as an object -

"categories": {
    "4": [6, 7, 8], 
    "9": [10]
}

The keys are category IDs, and the value is a list of tag IDs (if you prefer to receive the tags as a flat array of IDs instead of an object, let me know).

To add tags to a session, use the tags array -

{
    ...
    "tags": [1, 4, 6]
}

In both PATCH and PUT this should replace the existing list of tags on the session