REST API: Edit Reminders

Last Updated: July 20, 2015

Description

Edit one or more reminders for employees within your company. We will handle batches of up to 50 reminders at a time. More than 50 reminders will result in a 413 - Request entity too large error.

Resource Information

HTTP Method PUT
Endpoint https://rest.tsheets.com/api/v1/reminders
Authentication Token header required. See authentication section
Request format json object. Pass an array of reminder objects as the value to a 'data' property (see example below).
Response format json
Response object Reminder

Reminder Properties

When editing a reminder, you must uniquely identify the reminder by passing in its id property. Other properties defined on a reminder object may be passed in to the request with a new value in order to change it. If the value passed in is the same as it was previously, or if a particular property is not passed in at all, it will not be updated. Certain properties (created, last_modified, etc.) are set automatically by the system and may not be modified.

Status Codes

Each reminder that is edited will come back with a _status_code and _status_message that will indicate whether the reminder was edited successfully. If there was a problem editing a reminder, there may also be an additional field, _status_extra, which will contain more details about the failure.

_status_code Meaning
200 OK. Reminder was edited successfully.
417 Expectation Failed. Something was wrong or missing with the properties supplied for this reminder. See the _status_extra value for more detail.

Examples

Edit a user's clock-in and clock-out reminder due times and days of week.
Note: When attempting to run the example code below you will need to substitute the reminders listed and instead use ids associated with your TSheets account.

## REQUEST
curl -H "Authorization: Bearer <Access-Token>" -H "Content-Type: application/json" -X PUT -i "https://rest.tsheets.com/api/v1/reminders" -d @put_data.json 

## contents of the put_data.json file are:
{
    "data":[
        {
            "id": 73033,
            "due_time":"07:50:00", 
            "due_days_of_week":"Mon,Tue,Wed,Thu,Fri",
            "active":true,
            "enabled":true
        },
        {
            "id": 73035,
            "due_time":"17:10:00", 
            "due_days_of_week":"Mon,Tue,Wed,Thu,Fri", 
            "active":true,
            "enabled":true
        }
    ]
}


## RESPONSE
HTTP/1.1 200 OK
Content-Type: application/json
{
 "results": {
  "reminders": {
   "1": {
    "_status_code": 200,
    "_status_message": "Updated",
    "id": 73033,
    "reminder_type": "clock-in",
    "due_time": "07:50:00",
    "due_days_of_week": "Mon,Tue,Wed,Thu,Fri",
    "distribution_methods": "Push,SMS,Email",
    "active": true,
    "enabled": true,
    "last_modified": "2015-07-15T22:00:51+00:00",
    "created": "2015-07-15T22:00:51+00:00",
    "user_id": 37
   },
   "2": {
    "_status_code": 200,
    "_status_message": "Updated",
    "id": 73035,
    "reminder_type": "clock-out",
    "due_time": "17:10:00",
    "due_days_of_week": "Mon,Tue,Wed,Thu,Fri",
    "distribution_methods": "Push,SMS,Email",
    "active": true,
    "enabled": true,
    "last_modified": "2015-07-15T22:00:51+00:00",
    "created": "2015-07-15T22:00:51+00:00",
    "user_id": 37
   }
  }
 }
}