Return to documentation index

client_logs

The client_logs API allows posting arbitrary log data to the Tastevin database.

Parameters

  • api_key (string) Required - The API key for the current user.
  • logs (array) Required - An array of log objects to be saved.

Log objects

Each log object has three attributes:

  • client_timestamp - Time the log was originally recorded.
  • name - Name for the log (255 characters maximum)
  • data - Data to be logged

Response

The client_logs API returns a simple JSON success code:

{"status":"success"}

This code indicates that the request was received. It does not necessarily confirm that the log was successfully saved on the server.

Notes

This API must be called using the HTTP POST method with a content-type of application/x-www-form-urlencoded. Parameters should be URL encoded.

Saved logs will automatically be associated with the device and company implied by the API key and UDID used in the request (see Tastevin API Conventions for information on passing the UDID).

Sample Request

https://dashboard.onpremisewine.com/client_logs.json?api_key=M5EgGqz8ykNCaPjScCBK&logs%5B%5D%5Bclient_timestamp%5D=2013-01-03&logs%5B%5D%5Bname%5D=a%20log&logs%5B%5D%5Bdata%5D=Some%20log%20data&logs%5B%5D%5Bclient_timestamp%5D=2013-01-04&logs%5B%5D%5Bname%5D=another%20log&logs%5B%5D%5Bdata%5D=Some%20more%20log%20data

This corresponds to the following data, represented as JSON:

logs:[ { "client_timestamp":"2013-01-03", "name":"a log", "data":"Some log data" }, { "client_timestamp":"2013-01-04", "name":"anoter log", "data":"Some more log data" } ]

Sample Response

{"status":"success"}