Skip to content

Activities Endpoint

aris alexis edited this page Feb 8, 2016 · 1 revision

Restricted GET /activities/{id}?status=&view=false fetches an Activity Object according to the permission level. view for incrementing views and pastEvents to include all and not only OPEN status

Restricted GET /activities/{id}/events/{id} fetches a specific event with the parent activity embedded

Restricted GET /activities/byUser/{id}?start,size,status fetches an Activity[] for the specific user and according to the access level (owner or viewer)

GET /activities/byLocation query params: integer start,integer size,double lon,double lat,integer radius. fetches an Activity[] with the geolocation params.

GET /activities/byText query param String keywords (space separated string),Integer start,Integer size. fetches an Activity[] for the best match of these keywords

GET /activities/byTextAndLocation combines all the query params from the two searches above

GET /activities/byTags query params String tags(space separated) , paginated

GET /activities/front this (not fully implemented yet) endpoint returns the frontpage activities according to our best guess for the geolocation,previous cookies or most popular if we have no information

Restricted POST /activities create a new activity. takes a JSON Activity object with all the not null params set

Restricted PUT /activities/{id} update an activity. takes a JSON Activity object with all the not null params set important note if you are removing an image it's ok. if you are adding an image you need to send it to the storage and approval endpoint and it will be added automatically, not here. that's a security feature.

Restricted DELETE /activitites/{id} must be owner. returns HTTP OK or HTTP FORBIDDEN (403)

GET /activities/{id}/events

Restricted GET /activities/byUser/{username}/events (List for specific user maybe will be transfered to the users endpoint)

Restricted GET /activities/requests/{requestId}

Events for Activities (in the same endpoint)

Proposing an event and its requests need a workflow that is describe below as a user story:

request a new event for an existing activity Restricted POST /activities/{id}/requests EventRequest with action=ADD_EVENT

Restricted PUT /activities/requests/{requestId} EventRequest with status=ACCEPTED or REJECTED or VOTING

delete a request as owner of the request, this must be done before accepted or rejected otherwise its a no-op unless it was a participation request in which case you are deleted from the participants list Restricted DELETE /activities/requests/{requestId}

request a modification of an existing event Restricted POST /activities/{id}/events/{eventId}/requests EventRequest with action=UPDATE_EVENT and new data

vote to a request that has voting status reply to a new event request Restricted POST /activities/requests/{requestId}/votes Vote object

cancel a request (as the requestor and only if the request has Status.Pending) Restricted DELETE /activities/requests/{requestId} or Restricted DELETE /activities/{id}/events/{eventId}/requests/{requestId}

request to participate to an event Restricted POST /activities/{id}/events/{eventId}/requests EventRequest with action=PARTICIPATE_EVENT

follow actions will be done through the request flow when owner accepts but they are still represented here Restricted POST /activities/{id}/events Event will create an event (only the owner of the activity can do this) Restricted PUT /activities/{id}/events/{eventId} Event will update an event (only the owner of the activity can do this) deleting an event is done by the activity owner Restricted DELETE /activities/{id}/events/{eventId}

Restricted POST /activities/{id}/events/{eventId}/rating with a Rating object. the event can only be the eventId

Clone this wiki locally