-
Notifications
You must be signed in to change notification settings - Fork 20
API V2 changes from V1
The V1 API is located at /api/1 and /api/1/rest. A fully RESTful V2 API will be at /api/2.
Create new session for project when client establishes connection:
POST api/2/sessions
If client already has device_id, it should be included as a parameter to indicate to the server that a new device_id needn't be created and to be recorded in the new session record to establish a connection between all sessions for the same device.
Then retrieve data from project, speaker and audiotrack models related to project:
GET api/2/projects/:id
GET api/2/projects/:id/tags
I am not sure how best to RESTfully include the optional session_id parameter.My gut tells me that optional parameters can be consistently included as a query argument rather than part of the URL path, but I have not found clear best practices. In other words, in this case, if the client wanted to include the session_id, which is used to determine the localization of the session, the request would look like this:
GET api/2/projects/:id/tags?session_id=1
Session ID will be handled by authentication, details TBD
A basic request for new stream, not plural because you get one per authentication:
POST api/2/stream
A request for a new stream with additional optional parameters:
POST api/2/stream?project=1&latitude=1&longitude=1&tags=1,2,3&audio_stream_bitrate=128
Modifying the tag filters of an existing stream:
PATCH api/2/stream/?tags=1,2,3
Change the location of the listener for an existing stream (geo_listen_enabled projects only):
PATCH api/2/stream/?latitude=2&longitude=2
GET api/2/stream/current
PUT api/2/stream/current/:aid
PATCH api/2/stream/actions/next
POST api/2/stream/actions/heartbeat
POST api/2/envelopes/
additional parameter:
session_id
POST api/2/envelopes/:id/assets/:id
additional parameters:
latitude
longitude
tags
mediatype
file
submitted
GET api/2/assets/:id
GET api/2/projects/:id/assets/?tagids=26,36&latitude=47.654139&longitude=-122.335914&radius=500&mediatype=audio
additional optional parameters:
envelope_id
language
POST api/2/events/
including data:
session_id
event_type
latitude
longitude
tags
POST api/2/assets/:id/actions/vote/[type]