Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

URL

Request

Query Parameters

Behavior

api2/user/messages

GET

 

Returns any messages not already read by the client

api2/user/messages

GET

timeout=20

If new messages not already read by the client exist, these are returned. If no new messages exist, the request will stall for a number of seconds as defined in the timeout= parameter. If a new message arrives during this time, the request will immediately resolve, returning the new message.

api2/user/messages

GET

history=10

Returns the last 10 messages in the timeline

Response codes follow normal HTTP meanings:

Response Code

Meaning

200

Success - Response body should include messages

204

No Content - No new messages in the stream (only returned for base URL and ?timeout= requests, not for ?history= requests). Should be 304 Not Modified, but not currently supported in Lift.

403

Forbidden - Either the session is invalid or non-existent, or the user is not authorized to access the resource. Eventually we'll move to 401s for invalid/non-existent sessions, but currently we can't return a WWW-Authenticate header field that will result in the right behavior, so we're just stopping the request dead with a 403.

404

Not found - for example, a request for the stream of a tag that doesn't exist

Once this interface Please note that this interface is not yet implemented on any of the api2 URLs. Once it is implemented where planned for a URL, the "Yes" above in the "Streaming?" column will be bolded.

...