Simple In/Out API v4 Documentation

Welcome to the Simple In/Out API! You can use our API to access Simple In/Out data. You can request both read and write access.

The Simple In/Out v4 API is a RESTful (mostly) API protected by OAuth 2.

Rate Limiting

APIv4 is protected by daily rate limits. Currently, your application can access APIv4 up to 10,000 times per 24 hour period. Every request to APIv4 will return with two headers: X-RateLimit-Limit and X-RateLimit-Remaining. X-RateLimit-Limit will indicate the total number of requests that can be made against APIv4 over a 24 hour period (always 10,000 for now). X-RateLimit-Remaining will indicate how many requests you have left.

When you’ve run out of requests, APIv4 will return a HTTP status of 429 indicating Too Many Requests.

Expansions

Some of our APIs allow you to include additional information. This saves on API calls, as you can retrieve related information in the primary call and avoid additional requests.

When an API supports including additional information, it does so via the expand query parameter. This is a comma-delimited list of resources to include. We support expansions via embedding directly into the payload.

The Meta object

Most API payloads include a meta object to provide additional details about the requested resource(s). This includes paging most often, and sometimes additional information about the user making the request. For some payloads there may be additional items in the meta.

Here’s an example of a meta object

{"meta": {
  "paging": {
    "page": 1,
    "page_size": 25,
    "page_count": 2,
    "count": 47,
    "previous_page": null,
    "next_page": 2,
    "first_href": "https://www.simpleinout.com/api/v4/beacons",
    "last_href": "https://www.simpleinout.com/api/v4/beacons?page=2",
    "previous_href": null,
    "next_href": "https://www.simpleinout.com/api/v4/beacons?page=2"
  },
  "last_updated_at": {
    "beacons": 1435250484,
    "favorites": 1437151284,
    "fences": 1436546484,
    "groups": 1436287284,
    "settings": 1439916084
  }
}}

Pagination

Pagination occurs when requesting multiple objects. Information about this appears in the meta object.

Name Description
page the page number currently being returned
page_size the number of results per page
page_count the total number of pages available
count the total number of results
previous_page the number of the previous page
next_page the number of the next page
first_href the URL of the API call for the first page of results
last_href the URL of the API call for the last page of results
previous_href the URL of the API call for the page of results prior to the current page
next_href the URL of the API call for the page of results after the current page

Last Update At

The last_updated_at attribute in the meta object returns the epoch time indicating the last time certain resources have been updated. This applies to the authorized user’s company. By storing these dates, you can discover when resources have been updated without having to poll those resources on a regular basis.

If Modified Since and If None Match

Most of the GET requests to the API support the If-Modified-Since and If-None-Match headers. If these two headers are present, the GET request will only return a payload if the relevant data has been updated since the time specified in the If-Modified-Since header and the ETag in the If-None-Match header. If it has been updated since, the payload will be the same as usual. If the data has not been updated, the return will be empty with a HTTP status of 304 (Not Modified). The format of the time is in the HTTP specification, while the ETag should be the same as that returned when a request has been made previously.

When a GET API returns data, the Last-Modified header will be present providing the exact time it’s been modified. This date should be used for future If-Modified-Since requests. The ETag header will be present providing the hash value representing the returned payload. This hash should be used for future If-None-Match requests.

Range Searching

Some integer or date/time fields can be searched by using operators. This permits exact searches, as well as less than, greater than, or between. For these fields, you have an array of options.

  • For exact matches, simply include the value. Date/time fields use epoch time, so it’s almost impossible to get an exact match to the second. Examples are 18 or 1524168783.
  • For ranges based on a single value, you may prepend a symbol to the front of the value. The symbols <, >, <=, or >= are supported. Examples are <18 or >=1524168783.
  • For between range searches, the .. operator is used in between the two values. This includes the values on both ends, as well as those in between. Examples are 9..18 or 1523854800..1524459599.

Sorting

When requesting multiple objects, most of the time you’ll have some sorting options available. Sorting occurs by passing in the sort query parameter. The value is a comma-delimited string of fields in the order you wish them to be sorted. By default, all fields will sort in ascending fashion, but you can sort in descending fashion by including a - sign before the field. An example of this would be sort=name,-begin_at.

Errors

Error objects in Simple In/Out consist of three parts: code, message, and details.

  • code corresponds with those listed below. These provide context as to what type of error occurred.
  • message is an English plain-text reading of what happened. This should be used for further developer debugging, but should not be relied on to remain consistent over time. While these messages can be displayed to end-users, it is highly discouraged as they can change without notice and they are always going to be in English.
  • details provides an array of information in the case of validation failures. This will typically be populated with 5005 validation errors, though they also can appear with improperly formatted status updates (2002). The format of the objects in the array are key: value pairs, whereby key is the name of a field and value is one of a number of possible strings to indicated more specfically what was invalid with the input. Please note that while the key will typically be a parameter on the object, it can occassionally be base for errors that fail validation but don’t apply to a particular field.

An example of an error payload:

{
  "code": 5005,
  "message": "Validation Failure: Name can't be blank, UUID is invalid, Beacons exceed company limit of 100",
  "details": [
    { "name": "blank" },
    { "uuid": "invalid" },
    { "base": "greater_than" }
  ]
}

Error Codes

1002: Company is Disabled

Either the user’s company was on a trial and the trial has expired or the company has let their subscription to Simple In/Out expire. This error will present itself on almost all APIs and will return with the status code 403.


2002: Status Failure

The status update could not be completed.


5001: Bad Range

The integer or date value/range is invalid.


5002: Unknown Sort

The sort requested does not exist. The full message of this error will provide more explanation.


5003: Unknown Expansion

The expansion requested does not exist. The full message of this error will provide more explanation.


5005: Validation Failure

When attempting to create/update/delete the object, some data was either missing or invalid. The full message of this error will provide more explanation.


5007: Parameters Missing

A required parameter for this API was missing.


5008: Array Required

A parameter which is required to be an array was passed something other than an array.


5009: Unknown Only

The only field requested does not exist. The full message of this error will provide more explanation.


5010: Invalid Float

The floating point number is invalid.

Error Details

taken

The attribute is not unique

inclusion

The attribute is not in the list of acceptable values

invalid

The attribute is not valid

empty

The attribute cannot be empty

blank

The attribute cannot be blank

too_long

The attribute is too long

not_a_hex

The attribute is not a valid hex color code

not_a_number

The attribute is not a number

not_an_integer

The attribute is not an integer

greater_than

The attribute is greater than a predefined limit

greater_than_or_equal_to

The attribute is greater than or equal to a predefined limit

less_than

The attribute is less than a predefined floor

less_than_or_equal_to

The attribute is greater than or equal to a predefined floor

too_long

The attribute is longer than allowed

too_short

The attribute is shorter than allowed

Forbidden Requests (403)

When the user is authenticated, but doesn’t have the necessary permissions to perform an action, the server will respond with the status code of 403 and include the user’s privileges in the payload.

Example payload:

{
  "company": {
    "id": "1",
    "scheduled_statuses": true
  },
  "user": {
    "id": "5",
    "roles": {
      "name": "Regular User",
      "billing": false
      "followed_users": false,
      "reminders": false,
      "safeties": false,
      "tablet_access": false,
      "manage_company_and_users": false,
      "manage_groups_and_memberships": false,
      "manage_others_archives": false,
      "manage_others_futures": false,
      "manage_others_status": false,
      "manage_own_archives": false,
      "manage_own_futures": true,
      "manage_own_status": true,
      "view_badges": false,
      "view_others_archives": true,
      "view_others_futures": true,
      "view_others_reports": false,
      "view_status_updated_at": true,
      "view_users": true,
      "created_at": 1506268448,
      "updated_at": 1506269853
    }
  }
}

The privileges payload may not exist on all forbidden responses. In the cases when an error code is used, such as when a company is disabled, only the code and message will be returned.

Web Hooks

Web Hooks are a great way to be notified when something happens inside Simple In/Out. When you add a Web Hook URL to Simple In/Out, we’ll send a request to that URL with JSON in the body to tell you about things that have happened.

Currently, this applies to only two event types: status.new and status.destroy, though many may be added in the future. It is strongly advised that you code against the type attribute on the root of the JSON object to avoid new event types being added in the future having unexpected impacts on your code.

The root JSON keys define the basics and out of the box are compatible with Slack’s imcoming webhooks. This also means that the text with be formatted in Markdown. Within the data object is much of the information specific to Simple In/Out, including ids that can be used in combination with APIv4 to request further information.

{
  "username": "Bojack Horseman",
  "email": "bojack@horsinaround.com",
  "icon_url": "http://bojackhorseman.com/avatar.gif",
  "text": "*In*: In Hollywoo",
  "type": "status.new",
  "data": {
    "user_id": "34858",
    "status": "in",
    "comment": "In Hollywoo",
    "created_at": 1448046759,
    "admin": {
      "id": "2844", "name": "Princess Carolyn"
    },
    "application": {
      "id": "84774", "name": "Simple In/Out iOS"
    }
  }
}



Authentication

Authorization

Authorization is required to access the Simple In/Out API. This results in a HTTP 302 redirect to simpleinout.com. There, Simple In/Out will ask the user for their credentials and verify they wish to grant your application permission to act on their behalf. If they allow it, Simple In/Out will send a request to your redirect_uri with a code that you can use in the Authorization Code grant to have access and refresh tokens to access the API.

Endpoint

GET /oauth/authorize

Parameters

Name Description
response_type required (string) the type of authorization to use, in this case always 'code'
client_id required (string) your API client key
redirect_uri required (string) the URI to return the user to after authenticating, must match those registered with Simple In/Out
scope required (string) requested scope, either 'read' or 'write', by default 'read'
locale (string) the language for authorization. Available locales: en, en-au, en-ca, en-gb, es. Defaults to 'en'

Request

Route

GET /oauth/authorize?response_type=code&client_id=PLACE_YOUR_API_CLIENT_ID_HERE&redirect_uri=https%3A%2F%2Fbatzbailey.org&scope=write&locale=en

Query Parameters

response_type=code
client_id=PLACE_YOUR_API_CLIENT_ID_HERE
redirect_uri=https://batzbailey.org
scope=write
locale=en

cURL

curl -g "https://www.simpleinout.com/oauth/authorize?response_type=code&client_id=PLACE_YOUR_API_CLIENT_ID_HERE&redirect_uri=https%3A%2F%2Fbatzbailey.org&scope=write&locale=en" -X GET 

Response

Simulated Response

Status

302

Body

<html><body>You are being <a href="http://example.org/en/users/sign_in">redirected</a>.</body></html>

Authorization Code grant

Authorization Code should be used for accessing the API on behalf of a particular user. This is useful for pulling information about the user, or customizing the return of some APIs by the user’s preference.

The first step here is to have your user authorize your app for use. To do this, send your user to our site as noted to the left, passing your client_id and your redirect_uri. We’ll handle asking for the user, authenticating they are who they say they are, and handling the authorization (asking the user for permission on your behalf).

Once your user successfully authorizes your application, they will be redirected back to you. In this response will be a code in the form of a query string. Use this code to request tokens from Simple In/Out. You’ll then receive an access token and refresh token.

Endpoint

POST /oauth/token

Parameters

Name Description
grant_type required (string) type of grant to use
client_id required (string) your API client key
client_secret required (string) your API client secret
code required (string) if using Authorization Code grant, this is the code that is returned from Simple In/Out
redirect_uri required (string) the URI to return the user to after authenticating, must match those registered with Simple In/Out
scope (string) requested scope, either 'read' or 'write', defaults to 'read'

Request

Route

POST /oauth/token

Body

grant_type=authorization_code&client_id=YOUR_API_CLIENT_ID&client_secret=YOUR_API_CLIENT_SECRET&code=ef4044766668322fc17e55344d43ed621e9a95091d1767e3377fabf29ce1c029&redirect_uri=https%3A%2F%2Frobel.org

cURL

curl "https://www.simpleinout.com/oauth/token" -d 'grant_type=authorization_code&client_id=YOUR_API_CLIENT_ID&client_secret=YOUR_API_CLIENT_SECRET&code=ef4044766668322fc17e55344d43ed621e9a95091d1767e3377fabf29ce1c029&redirect_uri=https%3A%2F%2Frobel.org' -X POST 

Response

Simulated Response

Response Fields

Name Description
access_token (string) the access token used to make API requests
refresh_token (string) used with the Refresh Token grant type to request a new token
token_type (string) identifies the type of token
expires_in (integer) length of time, in seconds, that the token will be honored
scope (string) the scope of the token, either 'read' or 'write'
created_at (integer) the time the token was issued
user (object) the authenticated user's id and role.

Status

200

Headers

ETag: W/"588374d54acf8956fe71f7716cf2b401"

Body

{
  "access_token": "8f6030463826536efbb2f006de095eb80d40e06aae36ed43818f8bc998c5e453",
  "token_type": "bearer",
  "expires_in": 604800,
  "refresh_token": "330c2bd5f951eb45e74716f8e9de42edec5d009d53a57804d8d79657d0fe537e",
  "scope": "write",
  "created_at": 1550001556,
  "user": {
    "id": "10856",
    "roles": {
      "id": "25081",
      "name": "Administrator",
      "billing": true,
      "followed_users": true,
      "reminders": true,
      "safeties": true,
      "user_board": true,
      "manage_company_and_users": true,
      "manage_groups_and_memberships": true,
      "manage_others_archives": true,
      "manage_others_futures": true,
      "manage_others_status": true,
      "manage_own_archives": true,
      "manage_own_futures": true,
      "manage_own_status": true,
      "view_others_archives": true,
      "view_others_futures": true,
      "view_others_reports": true,
      "view_user_board_updated_at": true,
      "created_at": 1550001555,
      "updated_at": 1550001555
    }
  }
}

Refresh Token grant

Refresh Token should be used to renew your access token in the event that it has expired. This is useful for regaining access without again having to as the user for credentials.

Endpoint

POST /oauth/token

Parameters

Name Description
grant_type required (string) type of grant to use, in this case always 'refresh_token'
refresh_token required (string) your refresh token

Request

Route

POST /oauth/token

Body

grant_type=refresh_token&refresh_token=n39dob72qw9mwijk6jrtlb7x37jsb1f4

cURL

curl "https://www.simpleinout.com/oauth/token" -d 'grant_type=refresh_token&refresh_token=n39dob72qw9mwijk6jrtlb7x37jsb1f4' -X POST 

Response

Simulated Response

Response Fields

Name Description
access_token (string) the access token used to make API requests
refresh_token (string) used with the Refresh Token grant type to request a new token
token_type (string) identifies the type of token
expires_in (integer) length of time, in seconds, that the token will be honored
scope (string) the scope of the token, either 'read' or 'write'
created_at (integer) the time the token was issued
user (object) the authenticated user's id and role.

Status

200

Headers

ETag: W/"6b0323df3d9597f155f82c8db6ccd8e1"

Body

{
  "access_token": "84e13823411bc91e0d76772f2f87d98a946b786b92241b541535964ebeaa1d4f",
  "token_type": "bearer",
  "expires_in": 604800,
  "refresh_token": "c7c7ba387dac07c1c6fa13f60f7032862dea7155551f269f3ee4a1987cbe4e2a",
  "scope": "write",
  "created_at": 1550001556,
  "user": {
    "id": "10857",
    "roles": {
      "id": "25085",
      "name": "Administrator",
      "billing": true,
      "followed_users": true,
      "reminders": true,
      "safeties": true,
      "user_board": true,
      "manage_company_and_users": true,
      "manage_groups_and_memberships": true,
      "manage_others_archives": true,
      "manage_others_futures": true,
      "manage_others_status": true,
      "manage_own_archives": true,
      "manage_own_futures": true,
      "manage_own_status": true,
      "view_others_archives": true,
      "view_others_futures": true,
      "view_others_reports": true,
      "view_user_board_updated_at": true,
      "created_at": 1550001556,
      "updated_at": 1550001556
    }
  }
}

Revoke a token

Revokes a token, rendering it invalid.

Endpoint

POST /oauth/revoke

Parameters

Name Description
client_id required (string) your API client key
client_secret required (string) your API client secret
token required (string) the token to revoke

Request

Route

POST /oauth/revoke

Body

client_id=PLACE_YOUR_API_CLIENT_ID_HERE&client_secret=PLACE_YOUR_API_CLIENT_SECRET_HERE&token=eea3a06453478251050b877b9e70a65f4b147c0c28a1aa8e7c0930356acba547

cURL

curl "https://www.simpleinout.com/oauth/revoke" -d 'client_id=PLACE_YOUR_API_CLIENT_ID_HERE&client_secret=PLACE_YOUR_API_CLIENT_SECRET_HERE&token=eea3a06453478251050b877b9e70a65f4b147c0c28a1aa8e7c0930356acba547' -X POST 

Response

Simulated Response

Status

200

Headers

ETag: W/"44136fa355b3678a1146ad16f7e8649e"

Body

{}

Token information

Provides details about the OAuth token.

Endpoint

GET /oauth/token/info

Request

Route

GET /oauth/token/info

Headers

Authorization: Bearer a4a8285f998c2eddd6c214e43b0d2454aadecbf1e910f2f3622baa58502d1cc3

cURL

curl -g "https://www.simpleinout.com/oauth/token/info" -X GET \
	-H "Authorization: Bearer a4a8285f998c2eddd6c214e43b0d2454aadecbf1e910f2f3622baa58502d1cc3"

Response

Simulated Response

Response Fields

Name Description
resource_owner_id (integer) the id of the user
scopes (array) the scopes this token is authorized to use
expires_in_seconds (integer) the number of seconds until the token expires
application (object) information about the application
created_at (integer) the time the token was issued

Status

200

Headers

ETag: W/"47c2460b1e3cb8f23139ae1619d66bcd"

Body

{
  "resource_owner_id": 10855,
  "scopes": [
    "read"
  ],
  "expires_in_seconds": 604800,
  "application": {
    "uid": "7225041247303"
  },
  "created_at": 1550001555
}

Beacons

Create a beacon

Creates a new beacon. Once this beacon is created, it will appear in the company’s beacons within the Simple In/Out apps. The UUID can then be added to a hardware beacon to broadcast. Users must have a role that permits managing the company to create beacons. Companies are limited to 100 Beacons.

Endpoint

POST /api/v4/beacons

Parameters

Name Description
beacon[name] required (string) the name of the beacon
beacon[uuid] (string) the unique beacon identifier
beacon[comment_on_entry] (string) the comment applied to status updates on entry, defaults to 'In at {name}'
beacon[comment_on_exit] (string) the comment applied to status updates on exit, defaults to 'Left {name}'
beacon[status_on_entry] (string) the status to apply on entry: 'in', 'out', or 'off', defaults to 'in'
beacon[status_on_exit] (string) the status to apply on exit: 'in', 'out', or 'off', defaults to 'out'

Request

Route

POST /api/v4/beacons

Headers

Authorization: Bearer 3360a24d9d66e407182bf616aad87a56abe01e0c3faf6e7aa55bb0ea3e6cb8fd

Body

beacon[name]=My+Office&beacon[uuid]=6EA4801F-4D41-4114-AFA7-7EC977C81B41

cURL

curl "https://www.simpleinout.com/api/v4/beacons" -d 'beacon[name]=My+Office&beacon[uuid]=6EA4801F-4D41-4114-AFA7-7EC977C81B41' -X POST \
	-H "Authorization: Bearer 3360a24d9d66e407182bf616aad87a56abe01e0c3faf6e7aa55bb0ea3e6cb8fd"

Response

Simulated Response

Response Fields

Name Description
beacons (object) the newly created beacon attributes

Status

201

Headers

ETag: W/"16cad6dd53b5890ad5ce9b1fc93a7e55"

Body

{
  "beacons": {
    "id": "505",
    "name": "My Office",
    "uuid": "6EA4801F-4D41-4114-AFA7-7EC977C81B41",
    "comment_on_entry": "In at My Office",
    "comment_on_exit": "Left My Office",
    "entry": true,
    "exit": true,
    "status_on_entry": "in",
    "status_on_exit": "out",
    "created_at": 1550001548,
    "updated_at": 1550001548
  },
  "meta": {
    "last_updated_at": {
      "beacons": 1550001548,
      "favorites": 1548100748,
      "fences": 1541707148,
      "groups": 1544471948,
      "networks": 0,
      "roles": 1550001548,
      "settings": 1550001548
    }
  }
}

Delete a beacon

Deletes an existing beacon. Users must have a role that permits managing the company to delete beacons.

Endpoint

DELETE /api/v4/beacons/:id

Request

Route

DELETE /api/v4/beacons/507

Headers

Authorization: Bearer 93b6f8a1f5d4d1705e04d60d59d21b08ea7f6ece0b17dcea5a8302ab7b42d0e3

cURL

curl "https://www.simpleinout.com/api/v4/beacons/507" -d '' -X DELETE \
	-H "Authorization: Bearer 93b6f8a1f5d4d1705e04d60d59d21b08ea7f6ece0b17dcea5a8302ab7b42d0e3"

Response

Simulated Response

Status

204

List all beacons

Return a list of all the beacons belonging to the company.

Endpoint

GET /api/v4/beacons

Parameters

Name Description
sort (string) order of the return with optional '-' to denote descending, possibilities include: 'name'
page_size (integer) number of results to return per page, defaults to 25
page (integer) page number of results

Request

Route

GET /api/v4/beacons

Headers

Authorization: Bearer 189af77f69684834a6d4cfa95b9351e653b909c4435146036c5425d297764e6f

cURL

curl -g "https://www.simpleinout.com/api/v4/beacons" -X GET \
	-H "Authorization: Bearer 189af77f69684834a6d4cfa95b9351e653b909c4435146036c5425d297764e6f"

Response

Simulated Response

Response Fields

Name Description
beacons (array) an array of beacons

Status

200

Headers

ETag: W/"dde3d7dd7a602b03e03d1e543d18ad26"
Last-Modified: Tue, 12 Feb 2019 19:59:08 GMT

Body

{
  "beacons": [
    {
      "id": "504",
      "name": "Stanton-Dare",
      "uuid": "36ADE8B0-1368-467E-847D-B2CF8B87F5F5",
      "comment_on_entry": "In at Stanton-Dare",
      "comment_on_exit": "Left Stanton-Dare",
      "entry": true,
      "exit": true,
      "status_on_entry": "in",
      "status_on_exit": "out",
      "created_at": 1550001548,
      "updated_at": 1550001548
    },
    {
      "id": "503",
      "name": "Pacocha-Koepp",
      "uuid": "4AC1004A-C0D7-4D35-9F24-CFAF34D3F546",
      "comment_on_entry": "In at Pacocha-Koepp",
      "comment_on_exit": "Left Pacocha-Koepp",
      "entry": true,
      "exit": true,
      "status_on_entry": "in",
      "status_on_exit": "out",
      "created_at": 1550001548,
      "updated_at": 1550001548
    }
  ],
  "meta": {
    "paging": {
      "page": 1,
      "page_size": 25,
      "page_count": 1,
      "count": 2,
      "previous_page": null,
      "next_page": null,
      "first_href": "http://example.org/api/v4/beacons",
      "last_href": "http://example.org/api/v4/beacons",
      "previous_href": null,
      "next_href": null
    },
    "last_updated_at": {
      "beacons": 1550001548,
      "favorites": 1548359948,
      "fences": 1541879948,
      "groups": 1549828748,
      "networks": 0,
      "roles": 1550001548,
      "settings": 1550001548
    }
  }
}

Update a beacon

Updates an existing beacon. Please note that if the UUID of the beacon is updated, any corresponding hardware must also be updated to broadcast the new UUID. Users must have a role that permits managing the company to update beacons.

Endpoint

PATCH /api/v4/beacons/:id

Parameters

Name Description
beacon[name] (string) the name of the beacon
beacon[uuid] (string) the unique beacon identifier
beacon[comment_on_entry] (string) the comment applied to status updates on entry, defaults to 'In at {name}'
beacon[comment_on_exit] (string) the comment applied to status updates on exit, defaults to 'Left {name}'
beacon[status_on_entry] (string) the status to apply on entry: 'in', 'out', or 'off', defaults to 'in'
beacon[status_on_exit] (string) the status to apply on exit: 'in', 'out', or 'off', defaults to 'out'

Request

Route

PATCH /api/v4/beacons/506

Headers

Authorization: Bearer 5853dcfc4cf1cf8ca7d5824a63d05370a795355d497ad4c049a2d7528e4c3425

Body

beacon[name]=My+Renamed+Office

cURL

curl "https://www.simpleinout.com/api/v4/beacons/506" -d 'beacon[name]=My+Renamed+Office' -X PATCH \
	-H "Authorization: Bearer 5853dcfc4cf1cf8ca7d5824a63d05370a795355d497ad4c049a2d7528e4c3425"

Response

Simulated Response

Response Fields

Name Description
beacons (object) the newly updated beacon attributes

Status

200

Headers

ETag: W/"0d8c2e814a0d9e1ac377f7fbdb8635bf"

Body

{
  "beacons": {
    "id": "506",
    "name": "My Renamed Office",
    "uuid": "B7D721CB-1671-46C0-836B-A36AFA0AF466",
    "comment_on_entry": "In at My Renamed Office",
    "comment_on_exit": "Left My Renamed Office",
    "entry": true,
    "exit": true,
    "status_on_entry": "in",
    "status_on_exit": "out",
    "created_at": 1550001549,
    "updated_at": 1550001549
  },
  "meta": {
    "last_updated_at": {
      "beacons": 1550001549,
      "favorites": 1544212748,
      "fences": 1548964748,
      "groups": 1541793548,
      "networks": 0,
      "roles": 1550001548,
      "settings": 1550001548
    }
  }
}

Companies

Retrieve the current company

Return the company the authorized user belongs to.

Endpoint

GET /api/v4/companies/my

Parameters

Name Description
expand (string) comma-delimited list of extra information to include in the response, possibilities include: 'billing', 'beacons', 'fences', 'groups', 'favorites', 'networks', 'roles'

Request

Route

GET /api/v4/companies/my

Headers

Authorization: Bearer a0ac220ee1e571ff497e6fa479fad6c2d74e664dbce921dd533c7c4935bce72e

cURL

curl -g "https://www.simpleinout.com/api/v4/companies/my" -X GET \
	-H "Authorization: Bearer a0ac220ee1e571ff497e6fa479fad6c2d74e664dbce921dd533c7c4935bce72e"

Response

Simulated Response

Response Fields

Name Description
companies[name] (string) the authorized user's company name
companies[logo_url] (string) url of an image to be used as a fullscreen logo
companies[default_role_id] (string) the unique identifier for the default role
companies[scheduled_statuses] (boolean) whether Scheduled Statuses feature is enabled
companies[created_at] (integer) epoch time the company was created

Status

200

Headers

ETag: W/"a8eba8a793cb138d663a6e042030e915"
Last-Modified: Tue, 12 Feb 2019 19:59:18 GMT

Body

{
  "companies": {
    "id": "5599",
    "name": "Runolfsdottir-Willms",
    "scheduled_statuses": true,
    "default_role_id": "25159",
    "logo_url": null,
    "created_at": 1550001558
  },
  "meta": {
    "last_updated_at": {
      "beacons": 1547323158,
      "favorites": 1543607958,
      "fences": 1547841558,
      "groups": 1548878358,
      "networks": 0,
      "roles": 1550001558,
      "settings": 1550001558
    }
  }
}

Futures

Delete a future status

Deletes an existing scheduled status. The company must have scheduled statuses turned on. Users must have a role that permits managing their own scheduled statuses to delete one of their scheduled statuses. Users must have a role that permits managing the scheduled statuses of others to delete another user’s scheduled status.

Endpoint

DELETE /api/v4/futures/:id

Request

Route

DELETE /api/v4/futures/312

Headers

Authorization: Bearer db3b77dd54092d88d4e3c656dc11cc6b1167c857465c0b4077d59a4ca515be54

cURL

curl "https://www.simpleinout.com/api/v4/futures/312" -d '' -X DELETE \
	-H "Authorization: Bearer db3b77dd54092d88d4e3c656dc11cc6b1167c857465c0b4077d59a4ca515be54"

Response

Simulated Response

Status

204

List future statuses

List all the scheduled statuses. The company must have scheduled statuses turned on. Users must have a role that permits viewing the scheduled statuses of others or only the authorized user’s scheduled statuses will be returned.

Endpoint

GET /api/v4/futures

Parameters

Name Description
page_size (integer) number of results to return per page, defaults to 25
page (integer) page number of results
status (string) the status, either 'in' or 'out'
comment (string) the comment, case sensitive, included with the status change
apply_at (string) a date range string for the time this status will be added
user_id (string) the ID of a particular user
sort (string) order of the return with optional '-' to denote descending, possibilities include: 'apply_at', 'status', 'comment'"
expand (string) comma-delimited list of extra information to include in the response, possibilities include: 'user', 'changed_by_user'

Request

Route

GET /api/v4/futures

Headers

Authorization: Bearer d95fed79f67b142428247564f08e406bb8e32e4c05ab4cd527106ee35d3b03d4

cURL

curl -g "https://www.simpleinout.com/api/v4/futures" -X GET \
	-H "Authorization: Bearer d95fed79f67b142428247564f08e406bb8e32e4c05ab4cd527106ee35d3b03d4"

Response

Simulated Response

Response Fields

Name Description
futures (array) an array of matching future statuses

Status

200

Headers

ETag: W/"36098d7f980b5dcf2e37dc44d9a52331"
Last-Modified: Tue, 12 Feb 2019 19:59:16 GMT

Body

{
  "futures": [
    {
      "id": "310",
      "status": "out",
      "comment": "On Vacation, back Monday",
      "apply_at": 1552413600,
      "user_id": "10859",
      "changed_by_user_id": null
    },
    {
      "id": "311",
      "status": "out",
      "comment": "At the conference this week",
      "apply_at": 1565632800,
      "user_id": "10859",
      "changed_by_user_id": null
    }
  ],
  "meta": {
    "paging": {
      "page": 1,
      "page_size": 25,
      "page_count": 1,
      "count": 2,
      "previous_page": null,
      "next_page": null,
      "first_href": "http://example.org/api/v4/futures",
      "last_href": "http://example.org/api/v4/futures",
      "previous_href": null,
      "next_href": null
    },
    "last_updated_at": {
      "beacons": 1542571156,
      "favorites": 1549051156,
      "fences": 1548619156,
      "groups": 1546718356,
      "networks": 0,
      "roles": 1550001556,
      "settings": 1550001556
    }
  }
}

Geofences

Create a fence

Creates a new fence. Once this fence is created, it will appear in the company’s fences within the Simple In/Out apps and website. Users must have a role that permits managing the company to create fences. Companies are limited to 150 Geofences.

Endpoint

POST /api/v4/fences

Parameters

Name Description
fence[name] required (string) the name of the fence
fence[latitude] required (float) the latitude of the center point of the fence
fence[longitude] required (float) the longitude of the center point of the fence
fence[radius] required (integer) the radius of the fence, in meters
fence[comment_on_entry] (string) the comment applied to status updates on entry, defaults to 'In at {name}'
fence[comment_on_exit] (string) the comment applied to status updates on exit, defaults to 'Left {name}'
fence[status_on_entry] (string) the status to apply on entry: 'in', 'out', or 'off', defaults to 'in'
fence[status_on_exit] (string) the status to apply on exit: 'in', 'out', or 'off', defaults to 'out'

Request

Route

POST /api/v4/fences

Headers

Authorization: Bearer 6c501c0aaa80f013e5b15b33b1f4aeb9d68de9cda1cc7e4917653355d9144d13

Body

fence[name]=My+Office&fence[latitude]=46.877931&fence[longitude]=-96.787459&fence[radius]=150

cURL

curl "https://www.simpleinout.com/api/v4/fences" -d 'fence[name]=My+Office&fence[latitude]=46.877931&fence[longitude]=-96.787459&fence[radius]=150' -X POST \
	-H "Authorization: Bearer 6c501c0aaa80f013e5b15b33b1f4aeb9d68de9cda1cc7e4917653355d9144d13"

Response

Simulated Response

Response Fields

Name Description
fences (object) the newly created fence attributes

Status

201

Headers

ETag: W/"949c185e672ec31dc4b73ada0a7388df"

Body

{
  "fences": {
    "id": "314",
    "name": "My Office",
    "latitude": "46.877931",
    "longitude": "-96.787459",
    "radius": 150,
    "comment_on_entry": "In at My Office",
    "comment_on_exit": "Left My Office",
    "entry": true,
    "exit": true,
    "status_on_entry": "in",
    "status_on_exit": "out",
    "created_at": 1550001555,
    "updated_at": 1550001555
  },
  "meta": {
    "last_updated_at": {
      "beacons": 1548014355,
      "favorites": 1543953555,
      "fences": 1550001555,
      "groups": 1543089555,
      "networks": 0,
      "roles": 1550001555,
      "settings": 1550001555
    }
  }
}

Delete a fence

Deletes an existing fence. Users must have a role that permits managing the company to delete fences.

Endpoint

DELETE /api/v4/fences/:id

Request

Route

DELETE /api/v4/fences/313

Headers

Authorization: Bearer 15238f64edd91942bd5da97b4a97c7e708265de08441e3ffc6b57a6bf178a4c4

cURL

curl "https://www.simpleinout.com/api/v4/fences/313" -d '' -X DELETE \
	-H "Authorization: Bearer 15238f64edd91942bd5da97b4a97c7e708265de08441e3ffc6b57a6bf178a4c4"

Response

Simulated Response

Status

204

List all fences

Return a list of all the fences belonging to the company.

Endpoint

GET /api/v4/fences

Parameters

Name Description
sort (string) order of the return with optional '-' to denote descending, possibilities include: 'name', 'radius
page_size (integer) number of results to return per page, defaults to 25
page (integer) page number of results

Request

Route

GET /api/v4/fences

Headers

Authorization: Bearer b17dcc0726b96bb4eb6c37629ec398deb4cf0477eecab7a05dd5650a922ad748

cURL

curl -g "https://www.simpleinout.com/api/v4/fences" -X GET \
	-H "Authorization: Bearer b17dcc0726b96bb4eb6c37629ec398deb4cf0477eecab7a05dd5650a922ad748"

Response

Simulated Response

Response Fields

Name Description
fences (array) an array of fences

Status

200

Headers

ETag: W/"d872b5329997f254247a00bc1081bfde"
Last-Modified: Tue, 12 Feb 2019 19:59:14 GMT

Body

{
  "fences": [
    {
      "id": "312",
      "name": "9pa2n3u6bbt2f9xvys1k",
      "latitude": "-33.0700989688",
      "longitude": "-126.2547165948",
      "radius": 12974,
      "comment_on_entry": "In at 9pa2n3u6bbt2f9xvys1k",
      "comment_on_exit": "Left 9pa2n3u6bbt2f9xvys1k",
      "entry": true,
      "exit": true,
      "status_on_entry": "in",
      "status_on_exit": "out",
      "created_at": 1550001554,
      "updated_at": 1550001554
    },
    {
      "id": "311",
      "name": "8jmmlhvijy97h2rxpke4",
      "latitude": "85.9185266143",
      "longitude": "-149.1402980552",
      "radius": 7472,
      "comment_on_entry": "In at 8jmmlhvijy97h2rxpke4",
      "comment_on_exit": "Left 8jmmlhvijy97h2rxpke4",
      "entry": true,
      "exit": true,
      "status_on_entry": "in",
      "status_on_exit": "out",
      "created_at": 1550001554,
      "updated_at": 1550001554
    }
  ],
  "meta": {
    "paging": {
      "page": 1,
      "page_size": 25,
      "page_count": 1,
      "count": 2,
      "previous_page": null,
      "next_page": null,
      "first_href": "http://example.org/api/v4/fences",
      "last_href": "http://example.org/api/v4/fences",
      "previous_href": null,
      "next_href": null
    },
    "last_updated_at": {
      "beacons": 1547668754,
      "favorites": 1548187154,
      "fences": 1550001554,
      "groups": 1545335954,
      "networks": 0,
      "roles": 1550001554,
      "settings": 1550001554
    }
  }
}

Update a fence

Updates an existing fence. Users must have a role that permits managing the company to update fences.

Endpoint

PATCH /api/v4/fences/:id

Parameters

Name Description
fence[name] (string) the name of the fence
fence[latitude] (float) the latitude of the center point of the fence
fence[longitude] (float) the longitude of the center point of the fence
fence[radius] (integer) the radius of the fence, in meters
fence[comment_on_entry] (string) the comment applied to status updates on entry, defaults to 'In at {name}'
fence[comment_on_exit] (string) the comment applied to status updates on exit, defaults to 'Left {name}'
fence[status_on_entry] (string) the status to apply on entry: 'in', 'out', or 'off', defaults to 'in'
fence[status_on_exit] (string) the status to apply on exit: 'in', 'out', or 'off', defaults to 'out'

Request

Route

PATCH /api/v4/fences/315

Headers

Authorization: Bearer c145c8859e95255e2abecc3b92bc1264d95d00a178c64e3bb3042ead67fec2fb

Body

fence[name]=My+Renamed+Geofence

cURL

curl "https://www.simpleinout.com/api/v4/fences/315" -d 'fence[name]=My+Renamed+Geofence' -X PATCH \
	-H "Authorization: Bearer c145c8859e95255e2abecc3b92bc1264d95d00a178c64e3bb3042ead67fec2fb"

Response

Simulated Response

Response Fields

Name Description
fences (object) the newly updated fence attributes

Status

200

Headers

ETag: W/"3f06fe5daccc3b119d63e4a99d550864"

Body

{
  "fences": {
    "id": "315",
    "name": "My Renamed Geofence",
    "latitude": "76.4474620882",
    "longitude": "24.4577763199",
    "radius": 5164,
    "comment_on_entry": "In at My Renamed Geofence",
    "comment_on_exit": "Left My Renamed Geofence",
    "entry": true,
    "exit": true,
    "status_on_entry": "in",
    "status_on_exit": "out",
    "created_at": 1550001555,
    "updated_at": 1550001555
  },
  "meta": {
    "last_updated_at": {
      "beacons": 1543780755,
      "favorites": 1549310355,
      "fences": 1550001555,
      "groups": 1541447955,
      "networks": 0,
      "roles": 1550001555,
      "settings": 1550001555
    }
  }
}

Groups

Create a group

Creates a new group. Once this group is created, it will appear in the company’s groups within the Simple In/Out apps and website. Users must have a role that permits managing groups/memberships to create groups. Companies are limited to 100 Groups.

Endpoint

POST /api/v4/groups

Parameters

Name Description
group[name] required (string) the name of the group

Request

Route

POST /api/v4/groups

Headers

Authorization: Bearer 31d0a77d361825f813a516dfe995bb27e2ac9c3e241316ec1d9cae73ab58e556

Body

group[name]=New+Department

cURL

curl "https://www.simpleinout.com/api/v4/groups" -d 'group[name]=New+Department' -X POST \
	-H "Authorization: Bearer 31d0a77d361825f813a516dfe995bb27e2ac9c3e241316ec1d9cae73ab58e556"

Response

Simulated Response

Response Fields

Name Description
groups (object) the newly created group attributes

Status

201

Headers

ETag: W/"a4decef550f51fa146b2b1f5137c2dc4"

Body

{
  "groups": {
    "id": "391",
    "name": "New Department"
  },
  "meta": {
    "last_updated_at": {
      "beacons": 1545767958,
      "favorites": 1547150358,
      "fences": 1546286358,
      "groups": 1550001559,
      "networks": 0,
      "roles": 1550001558,
      "settings": 1550001558
    }
  }
}

Delete a group

Deletes an existing group. Users must have a role that permits managing groups/memberships to delete groups.

Endpoint

DELETE /api/v4/groups/:id

Request

Route

DELETE /api/v4/groups/390

Headers

Authorization: Bearer b96354a9d925df8288e5cd4b624b3ce16c1436a598c793cc0f0fe2d313c9f193

cURL

curl "https://www.simpleinout.com/api/v4/groups/390" -d '' -X DELETE \
	-H "Authorization: Bearer b96354a9d925df8288e5cd4b624b3ce16c1436a598c793cc0f0fe2d313c9f193"

Response

Simulated Response

Status

204

List all groups

Return a list of all the groups belonging to the company.

Endpoint

GET /api/v4/groups

Parameters

Name Description
sort (string) order of the return with optional '-' to denote descending, possibilities include: 'name'
page_size (integer) number of results to return per page, defaults to 25
page (integer) page number of results

Request

Route

GET /api/v4/groups

Headers

Authorization: Bearer 5a202ec9614c7bb044e0c4cd0d2fb1b4e0e58271da24472d76ff07bdf8fdda6f

cURL

curl -g "https://www.simpleinout.com/api/v4/groups" -X GET \
	-H "Authorization: Bearer 5a202ec9614c7bb044e0c4cd0d2fb1b4e0e58271da24472d76ff07bdf8fdda6f"

Response

Simulated Response

Response Fields

Name Description
groups (array) an array of groups

Status

200

Headers

ETag: W/"d776592e602fb7fd3eca42b4b5bfbd45"
Last-Modified: Tue, 12 Feb 2019 19:59:19 GMT

Body

{
  "groups": [
    {
      "id": "394",
      "name": "Marquardt LLC"
    },
    {
      "id": "393",
      "name": "Trantow, Lubowitz and Stroman"
    }
  ],
  "meta": {
    "paging": {
      "page": 1,
      "page_size": 25,
      "page_count": 1,
      "count": 2,
      "previous_page": null,
      "next_page": null,
      "first_href": "http://example.org/api/v4/groups",
      "last_href": "http://example.org/api/v4/groups",
      "previous_href": null,
      "next_href": null
    },
    "last_updated_at": {
      "beacons": 1541447959,
      "favorites": 1547063959,
      "fences": 1548964759,
      "groups": 1550001559,
      "networks": 0,
      "roles": 1550001559,
      "settings": 1550001559
    }
  }
}

Update a group

Updates an existing group. Users must have a role that permits managing groups/memberships to update groups.

Endpoint

PATCH /api/v4/groups/:id

Parameters

Name Description
group[name] (string) the name of the group

Request

Route

PATCH /api/v4/groups/392

Headers

Authorization: Bearer 10c68caf0a2d7fb6ecbf5992e5a2e1fb0eeae6c4685d594098313fd9e7ce5068

Body

group[name]=Renamed+Department

cURL

curl "https://www.simpleinout.com/api/v4/groups/392" -d 'group[name]=Renamed+Department' -X PATCH \
	-H "Authorization: Bearer 10c68caf0a2d7fb6ecbf5992e5a2e1fb0eeae6c4685d594098313fd9e7ce5068"

Response

Simulated Response

Response Fields

Name Description
groups (object) the newly updated group attributes

Status

200

Headers

ETag: W/"b347be0854f168472c9f269519371638"

Body

{
  "groups": {
    "id": "392",
    "name": "Renamed Department"
  },
  "meta": {
    "last_updated_at": {
      "beacons": 1541447959,
      "favorites": 1548446359,
      "fences": 1548791959,
      "groups": 1550001559,
      "networks": 0,
      "roles": 1550001559,
      "settings": 1550001559
    }
  }
}

Networks

Create a network

Creates a new network. Once this network is created, it will appear in the company’s networks within the Simple In/Out apps. Users must have a role that permits managing the company to create networks. Companies are limited to 100 Networks.

Endpoint

POST /api/v4/networks

Parameters

Name Description
network[name] required (string) the name of the network, no longer than 44 characters
network[ssid] required (string) the unique network identifier, no longer than 250 characters
network[comment_on_entry] (string) the comment applied to status updates on entry, defaults to 'In at {name}'
network[comment_on_exit] (string) the comment applied to status updates on exit, defaults to 'Left {name}'
network[status_on_entry] (string) the status to apply on entry: 'in', 'out', or 'off', defaults to 'in'
network[status_on_exit] (string) the status to apply on exit: 'in', 'out', or 'off', defaults to 'out'

Request

Route

POST /api/v4/networks

Headers

Authorization: Bearer 93f2de96e22e72dc8bc6c9bd247195b08a458acaa182ee9b58f6fbec91187400

Body

network[name]=My+Office&network[ssid]=Office+WiFi+Hotspot

cURL

curl "https://www.simpleinout.com/api/v4/networks" -d 'network[name]=My+Office&network[ssid]=Office+WiFi+Hotspot' -X POST \
	-H "Authorization: Bearer 93f2de96e22e72dc8bc6c9bd247195b08a458acaa182ee9b58f6fbec91187400"

Response

Simulated Response

Response Fields

Name Description
networks (object) the newly created network attributes

Status

201

Headers

ETag: W/"81067a33c0ab45f99d24c128b8fa4141"

Body

{
  "networks": {
    "id": "169",
    "name": "My Office",
    "ssid": "Office WiFi Hotspot",
    "comment_on_entry": "In at My Office",
    "comment_on_exit": "Left My Office",
    "entry": true,
    "exit": true,
    "status_on_entry": "in",
    "status_on_exit": "out",
    "created_at": 1550001549,
    "updated_at": 1550001549
  },
  "meta": {
    "last_updated_at": {
      "beacons": 1550001549,
      "favorites": 1549655949,
      "fences": 1545508749,
      "groups": 1545767949,
      "networks": 1550001549,
      "roles": 1550001549,
      "settings": 1550001549
    }
  }
}

Delete a network

Deletes an existing network. Users must have a role that permits managing the company to delete networks.

Endpoint

DELETE /api/v4/networks/:id

Request

Route

DELETE /api/v4/networks/167

Headers

Authorization: Bearer bdb92fbad61141fc7f7b679f7a79ad7f6117efe9d2456129986a8558df299dfd

cURL

curl "https://www.simpleinout.com/api/v4/networks/167" -d '' -X DELETE \
	-H "Authorization: Bearer bdb92fbad61141fc7f7b679f7a79ad7f6117efe9d2456129986a8558df299dfd"

Response

Simulated Response

Status

204

List all networks

Return a list of all the networks belonging to the company.

Endpoint

GET /api/v4/networks

Parameters

Name Description
sort (string) order of the return with optional '-' to denote descending, possibilities include: 'name'
page_size (integer) number of results to return per page, defaults to 25
page (integer) page number of results

Request

Route

GET /api/v4/networks

Headers

Authorization: Bearer 48035189711ff95adb1c705291e320505a2b86f4f90d51b4a3d18987a3454fa9

cURL

curl -g "https://www.simpleinout.com/api/v4/networks" -X GET \
	-H "Authorization: Bearer 48035189711ff95adb1c705291e320505a2b86f4f90d51b4a3d18987a3454fa9"

Response

Simulated Response

Response Fields

Name Description
networks (array) an array of networks

Status

200

Headers

ETag: W/"75137f9363c7ee5cd17cfa24036c0f91"
Last-Modified: Tue, 12 Feb 2019 19:59:09 GMT

Body

{
  "networks": [
    {
      "id": "165",
      "name": "Lindgren-Quitzon",
      "ssid": "ongmuqipbueti3621dsnsk0jdnjjuil1",
      "comment_on_entry": "In at Lindgren-Quitzon",
      "comment_on_exit": "Left Lindgren-Quitzon",
      "entry": true,
      "exit": true,
      "status_on_entry": "in",
      "status_on_exit": "out",
      "created_at": 1550001549,
      "updated_at": 1550001549
    },
    {
      "id": "166",
      "name": "Macejkovic-Hermiston",
      "ssid": "awrek8wnav1ppiodxm3atr4t90h8llbm",
      "comment_on_entry": "In at Macejkovic-Hermiston",
      "comment_on_exit": "Left Macejkovic-Hermiston",
      "entry": true,
      "exit": true,
      "status_on_entry": "in",
      "status_on_exit": "out",
      "created_at": 1550001549,
      "updated_at": 1550001549
    }
  ],
  "meta": {
    "paging": {
      "page": 1,
      "page_size": 25,
      "page_count": 1,
      "count": 2,
      "previous_page": null,
      "next_page": null,
      "first_href": "http://example.org/api/v4/networks",
      "last_href": "http://example.org/api/v4/networks",
      "previous_href": null,
      "next_href": null
    },
    "last_updated_at": {
      "beacons": 1549655949,
      "favorites": 1541707149,
      "fences": 1547582349,
      "groups": 1543262349,
      "networks": 1550001549,
      "roles": 1550001549,
      "settings": 1550001549
    }
  }
}

Update a network

Updates an existing network. Please note that if the SSID of the network is updated, any corresponding hardware must also be updated to broadcast the new SSID. Users must have a role that permits managing the company to update networks.

Endpoint

PATCH /api/v4/networks/:id

Parameters

Name Description
network[name] (string) the name of the network, no longer than 44 characters
network[ssid] (string) the unique network identifier, no longer than 250 characters
network[comment_on_entry] (string) the comment applied to status updates on entry, defaults to 'In at {name}'
network[comment_on_exit] (string) the comment applied to status updates on exit, defaults to 'Left {name}'
network[status_on_entry] (string) the status to apply on entry: 'in', 'out', or 'off', defaults to 'in'
network[status_on_exit] (string) the status to apply on exit: 'in', 'out', or 'off', defaults to 'out'

Request

Route

PATCH /api/v4/networks/168

Headers

Authorization: Bearer 9c1f4fdd41c19c83a3db2d378214d05609615a5809e5970b0d35df848b4b79e4

Body

network[name]=My+Renamed+Office

cURL

curl "https://www.simpleinout.com/api/v4/networks/168" -d 'network[name]=My+Renamed+Office' -X PATCH \
	-H "Authorization: Bearer 9c1f4fdd41c19c83a3db2d378214d05609615a5809e5970b0d35df848b4b79e4"

Response

Simulated Response

Response Fields

Name Description
networks (object) the newly updated network attributes

Status

200

Headers

ETag: W/"c47ba48ec0655b056a0722acd9d4f2f3"

Body

{
  "networks": {
    "id": "168",
    "name": "My Renamed Office",
    "ssid": "5xg0lfd15bpxrxkw2a7enmkkp53j9m3r",
    "comment_on_entry": "In at My Renamed Office",
    "comment_on_exit": "Left My Renamed Office",
    "entry": true,
    "exit": true,
    "status_on_entry": "in",
    "status_on_exit": "out",
    "created_at": 1550001549,
    "updated_at": 1550001549
  },
  "meta": {
    "last_updated_at": {
      "beacons": 1549828749,
      "favorites": 1545335949,
      "fences": 1543867149,
      "groups": 1544817549,
      "networks": 1550001549,
      "roles": 1550001549,
      "settings": 1550001549
    }
  }
}

Ok

Make sure things are Ok

This API is only used to verify you’ve successfully authorized.

Endpoint

GET /api/v4/ok

Request

Route

GET /api/v4/ok

Headers

Authorization: Bearer 50d00155257a589856a481c956934e92c457fcffd2c0eb946c041713890640d1

cURL

curl -g "https://www.simpleinout.com/api/v4/ok" -X GET \
	-H "Authorization: Bearer 50d00155257a589856a481c956934e92c457fcffd2c0eb946c041713890640d1"

Response

Simulated Response

Status

204

Roles

Create a role

Creates a new role. Once this role is created, it will be available to assign to users within the Simple In/Out apps and website. Users must have a role that permits managing the company to create roles. Companies are limited to 100 Roles.

Endpoint

POST /api/v4/roles

Parameters

Name Description
role[name] required (string) the name of the role, no longer than 255 characters, must be unique for the company
role[billing] (boolean) these users can change the company's plan, credit card, and invoice email/information.
role[followed_users] (boolean) these users can receive notifications on their devices when another user updates their status.
role[reminders] (boolean) these users can manage notifications sent to other users reminding them to update their status.
role[safeties] (boolean) these users can receive notifications when another user hasn't updated their status.
role[user_board] (boolean) these users can see other users and their current status.
role[manage_groups_and_memberships] (boolean) these users can manage groups and which users are assigned to each group.
role[manage_others_archives] (boolean) these users can change the past statuses of others by adding and deleting status updates.
role[manage_others_futures] (boolean) these users can schedule future status updates for other users.
role[manage_others_status] (boolean) these users can change the current status of other users.
role[manage_own_archives] (boolean) these users can change their own past statuses by adding and deleting status updates.
role[manage_own_futures] (boolean) these users can schedule future status updates for themselves.
role[manage_own_status] (boolean) these users can update their own status from any device or the website. If a user is not allowed to update their own status, they can only update their status from a common device running FrontDesk or TimeClock.
role[view_others_archives] (boolean) these users can view the past status updates made by other users.
role[view_others_futures] (boolean) these users can view the scheduled status updates for other users.
role[view_others_reports] (boolean) these users can run reports on the status history of other users.
role[view_user_board_updated_at] (boolean) these users can view the time that status updates were made on the board.

Request

Route

POST /api/v4/roles

Headers

Authorization: Bearer 09f29e39637275c9e611abf7ab2c2a9ec772fe1c9da40e81d2ffb325d4adb7d0

Body

role[name]=Billing+Role&role[billing]=true&role[followed_users]=false&role[reminders]=false&role[safeties]=false&role[user_board]=false&role[manage_groups_and_memberships]=false&role[manage_others_archives]=false&role[manage_others_futures]=false&role[manage_others_status]=false&role[manage_own_archives]=false&role[manage_own_futures]=false&role[manage_own_status]=false&role[view_others_archives]=false&role[view_others_futures]=false&role[view_others_reports]=false&role[view_user_board_updated_at]=false

cURL

curl "https://www.simpleinout.com/api/v4/roles" -d 'role[name]=Billing+Role&role[billing]=true&role[followed_users]=false&role[reminders]=false&role[safeties]=false&role[user_board]=false&role[manage_groups_and_memberships]=false&role[manage_others_archives]=false&role[manage_others_futures]=false&role[manage_others_status]=false&role[manage_own_archives]=false&role[manage_own_futures]=false&role[manage_own_status]=false&role[view_others_archives]=false&role[view_others_futures]=false&role[view_others_reports]=false&role[view_user_board_updated_at]=false' -X POST \
	-H "Authorization: Bearer 09f29e39637275c9e611abf7ab2c2a9ec772fe1c9da40e81d2ffb325d4adb7d0"

Response

Simulated Response

Response Fields

Name Description
roles (object) the newly created role attributes

Status

201

Headers

ETag: W/"3a07d9ccce481d92a16e95ef02491a54"

Body

{
  "roles": {
    "id": "25111",
    "name": "Billing Role",
    "billing": true,
    "followed_users": false,
    "reminders": false,
    "safeties": false,
    "user_board": false,
    "manage_company_and_users": false,
    "manage_groups_and_memberships": false,
    "manage_others_archives": false,
    "manage_others_futures": false,
    "manage_others_status": false,
    "manage_own_archives": false,
    "manage_own_futures": false,
    "manage_own_status": false,
    "view_others_archives": false,
    "view_others_futures": false,
    "view_others_reports": false,
    "view_user_board_updated_at": false,
    "created_at": 1550001556,
    "updated_at": 1550001556
  },
  "meta": {
    "last_updated_at": {
      "beacons": 1548273556,
      "favorites": 1549223956,
      "fences": 1543867156,
      "groups": 1541447956,
      "networks": 0,
      "roles": 1550001556,
      "settings": 1550001556
    }
  }
}

Delete a role

Deletes an existing role. Users must have a role that permits managing the company to delete roles.

Endpoint

DELETE /api/v4/roles/:id

Request

Route

DELETE /api/v4/roles/25116

Headers

Authorization: Bearer 825d150845ef62d488bc4fe0cd7716799c207f8e322ed89adfc1cee103e83f33

cURL

curl "https://www.simpleinout.com/api/v4/roles/25116" -d '' -X DELETE \
	-H "Authorization: Bearer 825d150845ef62d488bc4fe0cd7716799c207f8e322ed89adfc1cee103e83f33"

Response

Simulated Response

Status

204

List all roles

Return a list of all the roles belonging to the company.

Endpoint

GET /api/v4/roles

Parameters

Name Description
sort (string) order of the return with optional '-' to denote descending, possibilities include: 'name'
page_size (integer) number of results to return per page, defaults to 25
page (integer) page number of results

Request

Route

GET /api/v4/roles

Headers

Authorization: Bearer db2765148d68a39b34ff58044174506b11ce9c542540a1f9eaa2c1495719187d

cURL

curl -g "https://www.simpleinout.com/api/v4/roles" -X GET \
	-H "Authorization: Bearer db2765148d68a39b34ff58044174506b11ce9c542540a1f9eaa2c1495719187d"

Response

Simulated Response

Response Fields

Name Description
roles (array) an array of roles

Status

200

Headers

ETag: W/"e44728517b80c428a170eb070bc3ebdf"
Last-Modified: Tue, 12 Feb 2019 19:59:16 GMT

Body

{
  "roles": [
    {
      "id": "25118",
      "name": "Manager",
      "billing": false,
      "followed_users": false,
      "reminders": false,
      "safeties": false,
      "user_board": true,
      "manage_company_and_users": false,
      "manage_groups_and_memberships": false,
      "manage_others_archives": false,
      "manage_others_futures": true,
      "manage_others_status": true,
      "manage_own_archives": false,
      "manage_own_futures": true,
      "manage_own_status": true,
      "view_others_archives": true,
      "view_others_futures": true,
      "view_others_reports": true,
      "view_user_board_updated_at": true,
      "created_at": 1550001556,
      "updated_at": 1550001556
    },
    {
      "id": "25120",
      "name": "Limited User",
      "billing": false,
      "followed_users": false,
      "reminders": false,
      "safeties": false,
      "user_board": true,
      "manage_company_and_users": false,
      "manage_groups_and_memberships": false,
      "manage_others_archives": false,
      "manage_others_futures": false,
      "manage_others_status": false,
      "manage_own_archives": false,
      "manage_own_futures": false,
      "manage_own_status": false,
      "view_others_archives": true,
      "view_others_futures": true,
      "view_others_reports": false,
      "view_user_board_updated_at": true,
      "created_at": 1550001556,
      "updated_at": 1550001556
    },
    {
      "id": "25117",
      "name": "Administrator",
      "billing": true,
      "followed_users": true,
      "reminders": true,
      "safeties": true,
      "user_board": true,
      "manage_company_and_users": true,
      "manage_groups_and_memberships": true,
      "manage_others_archives": true,
      "manage_others_futures": true,
      "manage_others_status": true,
      "manage_own_archives": true,
      "manage_own_futures": true,
      "manage_own_status": true,
      "view_others_archives": true,
      "view_others_futures": true,
      "view_others_reports": true,
      "view_user_board_updated_at": true,
      "created_at": 1550001556,
      "updated_at": 1550001556
    },
    {
      "id": "25119",
      "name": "Regular User",
      "billing": false,
      "followed_users": false,
      "reminders": false,
      "safeties": false,
      "user_board": true,
      "manage_company_and_users": false,
      "manage_groups_and_memberships": false,
      "manage_others_archives": false,
      "manage_others_futures": false,
      "manage_others_status": false,
      "manage_own_archives": false,
      "manage_own_futures": true,
      "manage_own_status": true,
      "view_others_archives": true,
      "view_others_futures": true,
      "view_others_reports": false,
      "view_user_board_updated_at": true,
      "created_at": 1550001556,
      "updated_at": 1550001556
    }
  ],
  "meta": {
    "paging": {
      "page": 1,
      "page_size": 25,
      "page_count": 1,
      "count": 4,
      "previous_page": null,
      "next_page": null,
      "first_href": "http://example.org/api/v4/roles",
      "last_href": "http://example.org/api/v4/roles",
      "previous_href": null,
      "next_href": null
    },
    "last_updated_at": {
      "beacons": 1544126356,
      "favorites": 1545767956,
      "fences": 1543435156,
      "groups": 1547927956,
      "networks": 0,
      "roles": 1550001556,
      "settings": 1550001556
    }
  }
}

Retrieve a role

Retrieve an existing role.

Endpoint

GET /api/v4/roles/:id

Request

Route

GET /api/v4/roles/25101

Headers

Authorization: Bearer e545b16d6a6480f5e0228a065087800b2c6438e42dc2b190de093fef5ed010da

cURL

curl -g "https://www.simpleinout.com/api/v4/roles/25101" -X GET \
	-H "Sio-Version: 1.0.0" \
	-H "Authorization: Bearer e545b16d6a6480f5e0228a065087800b2c6438e42dc2b190de093fef5ed010da"

Response

Simulated Response

Response Fields

Name Description
roles (object) the role attributes

Status

200

Headers

ETag: W/"b304ea26399c0817697f020529b5ed61"
Last-Modified: Tue, 12 Feb 2019 19:59:16 GMT

Body

{
  "roles": {
    "id": "25101",
    "name": "Goodwin, Nitzsche and Cummings",
    "billing": false,
    "followed_users": false,
    "reminders": false,
    "safeties": false,
    "user_board": false,
    "manage_company_and_users": false,
    "manage_groups_and_memberships": false,
    "manage_others_archives": false,
    "manage_others_futures": false,
    "manage_others_status": false,
    "manage_own_archives": false,
    "manage_own_futures": false,
    "manage_own_status": false,
    "view_others_archives": false,
    "view_others_futures": false,
    "view_others_reports": false,
    "view_user_board_updated_at": false,
    "created_at": 1550001556,
    "updated_at": 1550001556
  },
  "meta": {
    "last_updated_at": {
      "beacons": 1549569556,
      "favorites": 1546286356,
      "fences": 1543262356,
      "groups": 1546372756,
      "networks": 0,
      "roles": 1550001556,
      "settings": 1550001556
    },
    "update_available": false
  }
}

Update a role

Updates an existing role. Users must have a role that permits managing the company to update roles.

Endpoint

PATCH /api/v4/roles/:id

Parameters

Name Description
role[name] (string) the name of the role, no longer than 255 characters, must be unique for the company
role[billing] (boolean) these users can change the company's plan, credit card, and invoice email/information.
role[followed_users] (boolean) these users can receive notifications on their devices when another user updates their status.
role[reminders] (boolean) these users can manage notifications sent to other users reminding them to update their status.
role[safeties] (boolean) these users can receive notifications when another user hasn't updated their status.
role[user_board] (boolean) these users can see other users and their current status.
role[manage_groups_and_memberships] (boolean) these users can manage groups and which users are assigned to each group.
role[manage_others_archives] (boolean) these users can change the past statuses of others by adding and deleting status updates.
role[manage_others_futures] (boolean) these users can schedule future status updates for other users.
role[manage_others_status] (boolean) these users can change the current status of other users.
role[manage_own_archives] (boolean) these users can change their own past statuses by adding and deleting status updates.
role[manage_own_futures] (boolean) these users can schedule future status updates for themselves.
role[manage_own_status] (boolean) these users can update their own status from any device or the website. If a user is not allowed to update their own status, they can only update their status from a common device running FrontDesk or TimeClock.
role[view_others_archives] (boolean) these users can view the past status updates made by other users.
role[view_others_futures] (boolean) these users can view the scheduled status updates for other users.
role[view_others_reports] (boolean) these users can run reports on the status history of other users.
role[view_user_board_updated_at] (boolean) these users can view the time that status updates were made on the board.

Request

Route

PATCH /api/v4/roles/25106

Headers

Authorization: Bearer de2e09b2ee292c97a263aead1d08d6583b36cad686970eb096c53e650eb14381

Body

role[name]=My+Renamed+Role&role[billing]=false&role[view_others_archives]=true&role[view_others_futures]=true

cURL

curl "https://www.simpleinout.com/api/v4/roles/25106" -d 'role[name]=My+Renamed+Role&role[billing]=false&role[view_others_archives]=true&role[view_others_futures]=true' -X PATCH \
	-H "Authorization: Bearer de2e09b2ee292c97a263aead1d08d6583b36cad686970eb096c53e650eb14381"

Response

Simulated Response

Response Fields

Name Description
roles (object) the newly updated role attributes

Status

200

Headers

ETag: W/"a326b40cd5aec94719bdb0c4b0b71d91"

Body

{
  "roles": {
    "id": "25106",
    "name": "My Renamed Role",
    "billing": false,
    "followed_users": false,
    "reminders": false,
    "safeties": false,
    "user_board": false,
    "manage_company_and_users": false,
    "manage_groups_and_memberships": false,
    "manage_others_archives": false,
    "manage_others_futures": false,
    "manage_others_status": false,
    "manage_own_archives": false,
    "manage_own_futures": false,
    "manage_own_status": false,
    "view_others_archives": true,
    "view_others_futures": true,
    "view_others_reports": false,
    "view_user_board_updated_at": false,
    "created_at": 1550001556,
    "updated_at": 1550001556
  },
  "meta": {
    "last_updated_at": {
      "beacons": 1548273556,
      "favorites": 1541793556,
      "fences": 1548791956,
      "groups": 1550001556,
      "networks": 0,
      "roles": 1550001556,
      "settings": 1550001556
    }
  }
}

Statuses

List statuses

List all the statuses within the time period specified by the ‘created_at’ date range. Users must have a role that permits viewing the status history of others or only the authorized user’s statuses will be returned.

Endpoint

GET /api/v4/statuses

Parameters

Name Description
page_size (integer) number of results to return per page, defaults to 25
page (integer) page number of results
created_at required (string) a date range string for the time the status was created
status (string) the status, either 'in' or 'out'
comment (string) the comment, case sensitive, included with the status change
user_id (string) the ID of a particular user
sort (string) order of the return with optional '-' to denote descending, possibilities include: 'created_at', 'status', 'comment'
expand (string) comma-delimited list of extra information to include in the response, possibilities include: 'user', 'user.memberships', 'user.memberships.group', 'user.phones', 'changed_by_user', 'application'

Request

Route

GET /api/v4/statuses?created_at=1549346400..1549605599

Headers

Authorization: Bearer 6d549e57998cc3240bcfa5d14ec63f7d674b52dea712694fe2f9a23fe4ec1524

Query Parameters

created_at=1549346400..1549605599

cURL

curl -g "https://www.simpleinout.com/api/v4/statuses?created_at=1549346400..1549605599" -X GET \
	-H "Authorization: Bearer 6d549e57998cc3240bcfa5d14ec63f7d674b52dea712694fe2f9a23fe4ec1524"

Response

Simulated Response

Response Fields

Name Description
statuses (array) an array of matching statuses

Status

200

Headers

ETag: W/"67a8c1dabc84f3fe40c88f1079d8a09b"
Last-Modified: Wed, 06 Feb 2019 15:00:00 GMT

Body

{
  "statuses": [
    {
      "status": "in",
      "comment": "At Work",
      "user_id": "10885",
      "changed_by_user_id": null,
      "created_at": 1549353600
    },
    {
      "status": "out",
      "comment": "Left Work",
      "user_id": "10885",
      "changed_by_user_id": null,
      "created_at": 1549368000
    },
    {
      "status": "in",
      "comment": "At Work",
      "user_id": "10885",
      "changed_by_user_id": null,
      "created_at": 1549371600
    },
    {
      "status": "out",
      "comment": "Left Work",
      "user_id": "10885",
      "changed_by_user_id": null,
      "created_at": 1549389600
    },
    {
      "status": "in",
      "comment": "At Work",
      "user_id": "10885",
      "changed_by_user_id": null,
      "created_at": 1549440000
    },
    {
      "status": "out",
      "comment": "Left Work",
      "user_id": "10885",
      "changed_by_user_id": null,
      "created_at": 1549461600
    },
    {
      "status": "out",
      "comment": "On Vacation",
      "user_id": "10885",
      "changed_by_user_id": "10886",
      "created_at": 1549465200
    }
  ],
  "meta": {
    "paging": {
      "page": 1,
      "page_size": 25,
      "page_count": 1,
      "count": 7,
      "previous_page": null,
      "next_page": null,
      "first_href": "http://example.org/api/v4/statuses?created_at=1549346400..1549605599",
      "last_href": "http://example.org/api/v4/statuses?created_at=1549346400..1549605599",
      "previous_href": null,
      "next_href": null
    },
    "last_updated_at": {
      "beacons": 1547755158,
      "favorites": 1547495958,
      "fences": 1546718358,
      "groups": 1547409558,
      "networks": 0,
      "roles": 1550001558,
      "settings": 1550001558
    }
  }
}

Users

Create a future status update for a user

Add a scheduled status for a specific user. Users must have a role that permits managing their own scheduled statuses if updating themselves or be permitted to manage the scheduled statuses of others if updating another user. The company must also have scheduled statuses enabled.

Endpoint

POST /api/v4/users/:id/futures

Parameters

Name Description
future[status] required (string) must be 'in' or 'out'
future[apply_at] required (integer) epoch time to apply status change, must be in the future, have minutes within (00, 15, 30, 45), and seconds of 0
future[comment] (string) up to 50 character description of the status update
expand (string) comma-delimited list of extra information to include in the response, possibilities include: 'user', 'changed_by_user'

Request

Route

POST /api/v4/users/10790/futures

Headers

Authorization: Bearer 5413ffa1aeb87c7ca1b410a6d02cc1c57c1cb8877cfa9b4e6402893fa76b0a5c

Body

future[status]=out&future[apply_at]=1555092000&future[comment]=On+Vacation

cURL

curl "https://www.simpleinout.com/api/v4/users/10790/futures" -d 'future[status]=out&future[apply_at]=1555092000&future[comment]=On+Vacation' -X POST \
	-H "Authorization: Bearer 5413ffa1aeb87c7ca1b410a6d02cc1c57c1cb8877cfa9b4e6402893fa76b0a5c"

Response

Simulated Response

Response Fields

Name Description
futures (object) the newly created future object

Status

201

Headers

ETag: W/"5e019f6cc9a5f7b358b45cfd7f68647d"

Body

{
  "futures": {
    "id": "305",
    "status": "out",
    "comment": "On Vacation",
    "apply_at": 1555092000,
    "user_id": "10790",
    "changed_by_user_id": "10789"
  },
  "meta": {
    "last_updated_at": {
      "beacons": 1548187151,
      "favorites": 1549310351,
      "fences": 1547927951,
      "groups": 1544039951,
      "networks": 0,
      "roles": 1550001551,
      "settings": 1550001551
    }
  }
}

Create a future status update for the current user

Add a scheduled status for the current user. Users must have a role that permits managing their own scheduled statuses and the company must have scheduled statuses enabled.

Endpoint

POST /api/v4/users/my/futures

Parameters

Name Description
future[status] required (string) must be 'in' or 'out'
future[apply_at] required (integer) epoch time to apply status change, must be in the future and have minutes within (00, 15, 30, 45), and seconds of 0
future[comment] (string) up to 50 character description of the status update
expand (string) comma-delimited list of extra information to include in the response, possibilities include: 'user', 'changed_by_user'

Request

Route

POST /api/v4/users/my/futures

Headers

Authorization: Bearer f472cad690c159a2d6e2910c7a9ebc4dd0a4214682a3a62c01323bc1d68d91d7

Body

future[status]=out&future[apply_at]=1555092000&future[comment]=On+Vacation

cURL

curl "https://www.simpleinout.com/api/v4/users/my/futures" -d 'future[status]=out&future[apply_at]=1555092000&future[comment]=On+Vacation' -X POST \
	-H "Authorization: Bearer f472cad690c159a2d6e2910c7a9ebc4dd0a4214682a3a62c01323bc1d68d91d7"

Response

Simulated Response

Response Fields

Name Description
futures (object) the newly created future object

Status

201

Headers

ETag: W/"3d4e5b1b9c89819760bc87684230d77a"

Body

{
  "futures": {
    "id": "304",
    "status": "out",
    "comment": "On Vacation",
    "apply_at": 1555092000,
    "user_id": "10775",
    "changed_by_user_id": null
  },
  "meta": {
    "last_updated_at": {
      "beacons": 1546027150,
      "favorites": 1546804750,
      "fences": 1547668750,
      "groups": 1548705550,
      "networks": 0,
      "roles": 1550001550,
      "settings": 1550001550
    }
  }
}

Create a status update for a user

Changes a user’s status. Users must have a role that permits managing their own current status or their own past statuses if updating themselves. Users must be permitted to manage the current status of others or the past status of others if updating another user.

Endpoint

POST /api/v4/users/:id/statuses

Parameters

Name Description
status[status] required (string) must be 'in' or 'out'
status[comment] (string) up to 50 character description of the status update
status[created_at] (integer) epoch time to apply status change, defaults to the current time (if this paramter is passed the date must be in the past)
expand (string) comma-delimited list of extra information to include in the response, possibilities include: 'user', 'user.memberships', 'user.phones', 'user.recents', 'changed_by_user', 'application'

Request

Route

POST /api/v4/users/10792/statuses

Headers

Authorization: Bearer f62bf2a43dc1d9e2943f57d114f30578eda33df5f9417f59edb4a0d5acac3feb

Body

status[status]=in&status[comment]=In+at+HQ

cURL

curl "https://www.simpleinout.com/api/v4/users/10792/statuses" -d 'status[status]=in&status[comment]=In+at+HQ' -X POST \
	-H "Authorization: Bearer f62bf2a43dc1d9e2943f57d114f30578eda33df5f9417f59edb4a0d5acac3feb"

Response

Simulated Response

Response Fields

Name Description
statuses (object) the newly created status object

Status

201

Headers

ETag: W/"eb4e144e12d5fe7c2a9c44796a4f602c"

Body

{
  "statuses": {
    "status": "in",
    "comment": "In at HQ",
    "user_id": "10792",
    "changed_by_user_id": "10791",
    "created_at": 1550001551
  },
  "meta": {
    "last_updated_at": {
      "beacons": 1544990351,
      "favorites": 1544385551,
      "fences": 1545163151,
      "groups": 1545854351,
      "networks": 0,
      "roles": 1550001551,
      "settings": 1550001551
    }
  }
}

Create a status update for the current user

Changes the current user’s status. Users must have a role that permits managing their own current status or their own past statuses.

Endpoint

POST /api/v4/users/my/statuses

Parameters

Name Description
status[status] required (string) must be 'in' or 'out'
status[comment] (st`ring) up to 50 character description of the status update
status[created_at] (integer) epoch time to apply status change, defaults to the current time (if this paramter is passed the date must be in the past)
expand (string) comma-delimited list of extra information to include in the response, possibilities include: 'user', 'user.memberships', 'user.phones', 'user.recents', 'changed_by_user', 'application'

Request

Route

POST /api/v4/users/my/statuses

Headers

Authorization: Bearer 660d69401b8e6e9616a451f5b18d39d748606f2a265e5b22a85ae7bd67dd439a

Body

status[status]=in&status[comment]=In+at+HQ

cURL

curl "https://www.simpleinout.com/api/v4/users/my/statuses" -d 'status[status]=in&status[comment]=In+at+HQ' -X POST \
	-H "Authorization: Bearer 660d69401b8e6e9616a451f5b18d39d748606f2a265e5b22a85ae7bd67dd439a"

Response

Simulated Response

Response Fields

Name Description
statuses (object) the newly created status object

Status

201

Headers

ETag: W/"576a33016661a1f9590bee94585118d9"

Body

{
  "statuses": {
    "status": "in",
    "comment": "In at HQ",
    "user_id": "10786",
    "changed_by_user_id": null,
    "created_at": 1550001551
  },
  "meta": {
    "last_updated_at": {
      "beacons": 1548014351,
      "favorites": 1544471951,
      "fences": 1544126351,
      "groups": 1544731151,
      "networks": 0,
      "roles": 1550001551,
      "settings": 1550001551
    }
  }
}

Create a user

Creates a new user. When this is completed, the user will be sent a welcome email from Simple In/Out with a link to choose their own password. Users must have a role that permits managing the company/users to create users. Companies are limited to the number of users their plan supports, and attempting to add more users will result in a greater_than error on the base parameter.

Endpoint

POST /api/v4/users

Parameters

Name Description
user[email] required (string) new user's email address
user[name] required (string) new user's full name
user[details] (string) additional text information about the user
user[lang] (string) preferred locale of the user defaulting to the locale of the authorized user, can be de, en-au, en-ca, en-gb, en, es, fr-ca, fr, ja, lv, nb, nl, ru, sq, sv
user[phones_attributes] (array) phone objects to attach to the user, each with a 'number' attribute
user[memberships_attributes] (array) membership objects to place the user in the group, each with a 'group_id' attribute
user[role_id] required (string) the ID of the role to assign to the user
only (string) comma-delimited list of fields to render only, possibilities include: 'id', 'name', 'email', 'image_url', 'details', 'lang', 'created_at', 'updated_at', 'cached_at'
expand (string) comma-delimited list of extra information to include in the response, possibilities include: 'memberships', 'memberships.group', 'phones', 'status', 'status.application', 'status.changed_by_user', 'recents', 'role'

Request

Route

POST /api/v4/users

Headers

Authorization: Bearer 71eea380f5da9b27ceb599b8d530dfae3dff36dfa38a1bbb93a20fac4974001f

Body

user[email]=bojack%40horsinaround.com&user[name]=Bojack+Horseman&user[details]=Lead+Actor&user[lang]=en&user[phones_attributes][][number]=623.567.1793&user[memberships_attributes][][group_id]=385&user[role_id]=24913

cURL

curl "https://www.simpleinout.com/api/v4/users" -d 'user[email]=bojack%40horsinaround.com&user[name]=Bojack+Horseman&user[details]=Lead+Actor&user[lang]=en&user[phones_attributes][][number]=623.567.1793&user[memberships_attributes][][group_id]=385&user[role_id]=24913' -X POST \
	-H "Authorization: Bearer 71eea380f5da9b27ceb599b8d530dfae3dff36dfa38a1bbb93a20fac4974001f"

Response

Simulated Response

Response Fields

Name Description
users (object) the newly created user object

Status

201

Headers

ETag: W/"69f844f606e9f02e6940a0f0bdde760a"

Body

{
  "users": {
    "id": "10774",
    "name": "Bojack Horseman",
    "email": "bojack@horsinaround.com",
    "image_url": "https://gravatar.com/avatar/a05868c1d1022f804699801238e5eb07.png?s=270\u0026d=blank",
    "details": "Lead Actor",
    "lang": "en",
    "role_id": "24913",
    "created_at": 1550001550,
    "updated_at": 1550001550,
    "cached_at": "1550001550.113010000"
  },
  "meta": {
    "last_updated_at": {
      "beacons": 1549396750,
      "favorites": 1550001550,
      "fences": 1546891150,
      "groups": 1550001550,
      "networks": 0,
      "roles": 1550001550,
      "settings": 1550001550
    }
  }
}

Delete a user

Deletes an existing user. Users must have a role that permits managing the company/users to delete users. Companies must have at least one user with the Administrator role, if you attempt to delete the last user with the Administrator role, this will result in a less_than error on the base parameter.

Endpoint

DELETE /api/v4/users/:id

Request

Route

DELETE /api/v4/users/10780

Headers

Authorization: Bearer 88185ddb679238b1488dec3bf64eaeec13627e74d8762922b942129e5b7fa92b

cURL

curl "https://www.simpleinout.com/api/v4/users/10780" -d '' -X DELETE \
	-H "Authorization: Bearer 88185ddb679238b1488dec3bf64eaeec13627e74d8762922b942129e5b7fa92b"

Response

Simulated Response

Status

204

Favorite a status for the current user

Designates a previous status update as a favorite for the current user’s Quick Picks.

Endpoint

PATCH /api/v4/users/my/statuses/favorite

Parameters

Name Description
status[status] required (string) must be 'in' or 'out'
status[comment] (string) up to 50 character description of the status update

Request

Route

PATCH /api/v4/users/my/statuses/favorite

Headers

Authorization: Bearer 438bfade6dc49cb9072ba1867875d01d8e6ea48b3e6e9f68cf2455fe778773a6

Body

status[status]=in&status[comment]=At+Lunch

cURL

curl "https://www.simpleinout.com/api/v4/users/my/statuses/favorite" -d 'status[status]=in&status[comment]=At+Lunch' -X PATCH \
	-H "Authorization: Bearer 438bfade6dc49cb9072ba1867875d01d8e6ea48b3e6e9f68cf2455fe778773a6"

Response

Simulated Response

Status

204

Hide a status for the current user

Hides a previous status update from the current user’s Quick Picks.

Endpoint

PATCH /api/v4/users/my/statuses/hide

Parameters

Name Description
status[status] required (string) must be 'in' or 'out'
status[comment] (string) up to 50 character description of the status update

Request

Route

PATCH /api/v4/users/my/statuses/hide

Headers

Authorization: Bearer f013d925190e704530c9b956de471ada80adbd1c0c1ed07367d5f29c4d4211bc

Body

status[status]=in&status[comment]=At+Lunch

cURL

curl "https://www.simpleinout.com/api/v4/users/my/statuses/hide" -d 'status[status]=in&status[comment]=At+Lunch' -X PATCH \
	-H "Authorization: Bearer f013d925190e704530c9b956de471ada80adbd1c0c1ed07367d5f29c4d4211bc"

Response

Simulated Response

Status

204

List all future statuses for a user

List all the scheduled statuses for the specified user. Please note that the user making this request must have a role with permission to view the scheduled statuses of others and the company must have scheduled statuses enabled.

Endpoint

GET /api/v4/users/:id/futures

Parameters

Name Description
comment (string) the comment, case sensitive, included with the status change
sort (string) order of the return with optional '-' to denote descending, possibilities include: 'apply_at', 'status', 'comment'
apply_at (string) a date range string for the time the status will be added
expand (string) comma-delimited list of extra information to include in the response, possibilities include: 'user', 'changed_by_user'
page_size (integer) number of results to return per page, defaults to 25
page (integer) page number of results

Request

Route

GET /api/v4/users/10795/futures

Headers

Authorization: Bearer 5ec39a9964f95cd0d3ab294e8bc23807d7c6b9ee74cacbe2b958629351856884

cURL

curl -g "https://www.simpleinout.com/api/v4/users/10795/futures" -X GET \
	-H "Authorization: Bearer 5ec39a9964f95cd0d3ab294e8bc23807d7c6b9ee74cacbe2b958629351856884"

Response

Simulated Response

Response Fields

Name Description
futures (array) an array of matching scheduled statuses

Status

200

Headers

ETag: W/"c2b91833abd17a80e36cce077aec6e9c"
Last-Modified: Tue, 12 Feb 2019 19:59:11 GMT

Body

{
  "futures": [
    {
      "id": "306",
      "status": "out",
      "comment": "Offsite Meeting",
      "apply_at": 1550563200,
      "user_id": "10795",
      "changed_by_user_id": null
    },
    {
      "id": "307",
      "status": "out",
      "comment": "Gone Fishing",
      "apply_at": 1556017200,
      "user_id": "10795",
      "changed_by_user_id": "10796"
    }
  ],
  "meta": {
    "paging": {
      "page": 1,
      "page_size": 25,
      "page_count": 1,
      "count": 2,
      "previous_page": null,
      "next_page": null,
      "first_href": "http://example.org/api/v4/users/10795/futures?user_id=10795",
      "last_href": "http://example.org/api/v4/users/10795/futures?user_id=10795",
      "previous_href": null,
      "next_href": null
    },
    "last_updated_at": {
      "beacons": 1549483151,
      "favorites": 1544471951,
      "fences": 1546804751,
      "groups": 1548791951,
      "networks": 0,
      "roles": 1550001551,
      "settings": 1550001551
    }
  }
}

List all future statuses for the current user

List all the scheduled statuses for the current user. Please note that the company must have scheduled statuses enabled for users to see their scheduled statuses.

Endpoint

GET /api/v4/users/my/futures

Parameters

Name Description
comment (string) the comment, case sensitive, included with the status change
sort (string) order of the return with optional '-' to denote descending, possibilities include: 'apply_at', 'status', 'comment'
apply_at (string) a date range string for the time the status will be added
expand (string) comma-delimited list of extra information to include in the response, possibilities include: 'user', 'changed_by_user'
page_size (integer) number of results to return per page, defaults to 25
page (integer) page number of results

Request

Route

GET /api/v4/users/my/futures

Headers

Authorization: Bearer ec2138077a7147a984523e7863fea8f98bd0622dd3d127dde67b2da8b0c1b06c

cURL

curl -g "https://www.simpleinout.com/api/v4/users/my/futures" -X GET \
	-H "Authorization: Bearer ec2138077a7147a984523e7863fea8f98bd0622dd3d127dde67b2da8b0c1b06c"

Response

Simulated Response

Response Fields

Name Description
futures (array) an array of matching scheduled statuses

Status

200

Headers

ETag: W/"12af3ecce67afda2f8e1d3ebc5a26c55"
Last-Modified: Tue, 12 Feb 2019 19:59:12 GMT

Body

{
  "futures": [
    {
      "id": "308",
      "status": "out",
      "comment": "Offsite Meeting",
      "apply_at": 1550563200,
      "user_id": "10803",
      "changed_by_user_id": null
    },
    {
      "id": "309",
      "status": "out",
      "comment": "Gone Fishing",
      "apply_at": 1556017200,
      "user_id": "10803",
      "changed_by_user_id": "10804"
    }
  ],
  "meta": {
    "paging": {
      "page": 1,
      "page_size": 25,
      "page_count": 1,
      "count": 2,
      "previous_page": null,
      "next_page": null,
      "first_href": "http://example.org/api/v4/users/my/futures?user_id=10803",
      "last_href": "http://example.org/api/v4/users/my/futures?user_id=10803",
      "previous_href": null,
      "next_href": null
    },
    "last_updated_at": {
      "beacons": 1543175952,
      "favorites": 1545940752,
      "fences": 1548100752,
      "groups": 1547236752,
      "networks": 0,
      "roles": 1550001552,
      "settings": 1550001552
    }
  }
}

List all statuses for a user

List all the statuses for the specified user within the time period specified by the ‘created_at’ date range. Users must have a role that permits viewing the past statuses of others if viewing another user. They can always view their own past statuses.

Endpoint

GET /api/v4/users/:id/statuses

Parameters

Name Description
created_at required (string) a date range string for the time the status was created
comment (string) the comment, case sensitive, included with the status change
sort (string) order of the return with optional '-' to denote descending, possibilities include: 'created_at', 'status', 'comment'
expand (string) comma-delimited list of extra information to include in the response, possibilities include: 'user', 'user.memberships', 'user.phones', 'user.recents', 'changed_by_user', 'application'
page_size (integer) number of results to return per page, defaults to 25
page (integer) page number of results

Request

Route

GET /api/v4/users/10805/statuses?created_at=1549346400..1549605599

Headers

Authorization: Bearer a57dba589b8c0dea2e1718f66066734b00c8f8517af832426ca42c6dfb4dfa81

Query Parameters

created_at=1549346400..1549605599

cURL

curl -g "https://www.simpleinout.com/api/v4/users/10805/statuses?created_at=1549346400..1549605599" -X GET \
	-H "Authorization: Bearer a57dba589b8c0dea2e1718f66066734b00c8f8517af832426ca42c6dfb4dfa81"

Response

Simulated Response

Response Fields

Name Description
statuses (array) an array of matching statuses

Status

200

Headers

ETag: W/"0fe2f8cdc5089c318869fb1c16b7891c"
Last-Modified: Wed, 06 Feb 2019 15:00:00 GMT

Body

{
  "statuses": [
    {
      "status": "in",
      "comment": "At Work",
      "user_id": "10805",
      "changed_by_user_id": null,
      "created_at": 1549353600
    },
    {
      "status": "out",
      "comment": "Left Work",
      "user_id": "10805",
      "changed_by_user_id": null,
      "created_at": 1549368000
    },
    {
      "status": "in",
      "comment": "At Work",
      "user_id": "10805",
      "changed_by_user_id": null,
      "created_at": 1549371600
    },
    {
      "status": "out",
      "comment": "Left Work",
      "user_id": "10805",
      "changed_by_user_id": null,
      "created_at": 1549389600
    },
    {
      "status": "in",
      "comment": "At Work",
      "user_id": "10805",
      "changed_by_user_id": null,
      "created_at": 1549440000
    },
    {
      "status": "out",
      "comment": "Left Work",
      "user_id": "10805",
      "changed_by_user_id": null,
      "created_at": 1549461600
    },
    {
      "status": "out",
      "comment": "Vacation",
      "user_id": "10805",
      "changed_by_user_id": "10806",
      "created_at": 1549465200
    }
  ],
  "meta": {
    "paging": {
      "page": 1,
      "page_size": 25,
      "page_count": 1,
      "count": 7,
      "previous_page": null,
      "next_page": null,
      "first_href": "http://example.org/api/v4/users/10805/statuses?created_at=1549346400..1549605599\u0026user_id=10805",
      "last_href": "http://example.org/api/v4/users/10805/statuses?created_at=1549346400..1549605599\u0026user_id=10805",
      "previous_href": null,
      "next_href": null
    },
    "last_updated_at": {
      "beacons": 1549137552,
      "favorites": 1544126352,
      "fences": 1542743952,
      "groups": 1545076752,
      "networks": 0,
      "roles": 1550001552,
      "settings": 1550001552
    }
  }
}

List all statuses for the current user

List all the statuses for the current user within the time period specified by the ‘created_at’ date range.

Endpoint

GET /api/v4/users/my/statuses

Parameters

Name Description
created_at required (string) a date range string for the time the status was created
comment (string) the comment, case sensitive, included with the status change
sort (string) order of the return with optional '-' to denote descending, possibilities include: 'created_at', 'status', 'comment'
expand (string) comma-delimited list of extra information to include in the response, possibilities include: 'user', 'user.memberships', 'user.phones', 'user.recents', 'changed_by_user', 'application'
page_size (integer) number of results to return per page, defaults to 25
page (integer) page number of results

Request

Route

GET /api/v4/users/my/statuses?created_at=1549346400..1549605599

Headers

Authorization: Bearer b6f7d79e1199902087fb62ae1c6b507f00452a929e12793847278fb9530340a2

Query Parameters

created_at=1549346400..1549605599

cURL

curl -g "https://www.simpleinout.com/api/v4/users/my/statuses?created_at=1549346400..1549605599" -X GET \
	-H "Authorization: Bearer b6f7d79e1199902087fb62ae1c6b507f00452a929e12793847278fb9530340a2"

Response

Simulated Response

Response Fields

Name Description
statuses (array) an array of matching statuses

Status

200

Headers

ETag: W/"71d11324d3d9293a4903547b4346bb9a"
Last-Modified: Wed, 06 Feb 2019 15:00:00 GMT

Body

{
  "statuses": [
    {
      "status": "in",
      "comment": "At Work",
      "user_id": "10784",
      "changed_by_user_id": null,
      "created_at": 1549353600
    },
    {
      "status": "out",
      "comment": "Left Work",
      "user_id": "10784",
      "changed_by_user_id": null,
      "created_at": 1549368000
    },
    {
      "status": "in",
      "comment": "At Work",
      "user_id": "10784",
      "changed_by_user_id": null,
      "created_at": 1549371600
    },
    {
      "status": "out",
      "comment": "Left Work",
      "user_id": "10784",
      "changed_by_user_id": null,
      "created_at": 1549389600
    },
    {
      "status": "in",
      "comment": "At Work",
      "user_id": "10784",
      "changed_by_user_id": null,
      "created_at": 1549440000
    },
    {
      "status": "out",
      "comment": "Left Work",
      "user_id": "10784",
      "changed_by_user_id": null,
      "created_at": 1549461600
    },
    {
      "status": "out",
      "comment": "Vacation",
      "user_id": "10784",
      "changed_by_user_id": "10785",
      "created_at": 1549465200
    }
  ],
  "meta": {
    "paging": {
      "page": 1,
      "page_size": 25,
      "page_count": 1,
      "count": 7,
      "previous_page": null,
      "next_page": null,
      "first_href": "http://example.org/api/v4/users/my/statuses?created_at=1549346400..1549605599\u0026user_id=10784",
      "last_href": "http://example.org/api/v4/users/my/statuses?created_at=1549346400..1549605599\u0026user_id=10784",
      "previous_href": null,
      "next_href": null
    },
    "last_updated_at": {
      "beacons": 1542398350,
      "favorites": 1542398350,
      "fences": 1549655950,
      "groups": 1544558350,
      "networks": 0,
      "roles": 1550001550,
      "settings": 1550001550
    }
  }
}

List all users

Return a list of all the users belonging to the company. Users must have a role that permits viewing users.

Endpoint

GET /api/v4/users

Parameters

Name Description
page_size (integer) number of results to return per page, defaults to 25
page (integer) page number of results
name (string) return users with this name
email (string) return users with this email
id (array) return users by an array of ids
group_id (string/array) return users belonging to a group id, which can be a string or array in the form of group_id[]=INT
cached_at (integer/float) return users updated that have made a significant change since an epoch time, accurate to nanoseconds
sort (string) order of the return with optional '-' to denote descending, possibilities include: 'name', 'email', 'cached_at', 'status.status', 'status.created_at'
only (string) comma-delimited list of fields to render only, possibilities include: 'id', 'name', 'email', 'image_url', 'details', 'lang', 'created_at', 'updated_at', 'cached_at'
expand (string) comma-delimited list of extra information to include in the response, possibilities include: 'memberships', 'memberships.group', 'phones', 'status', 'status.application', 'status.changed_by_user', 'recents', 'role'

Request

Route

GET /api/v4/users

Headers

Authorization: Bearer 8776c37dbbef69fb2799d812c5eb882c086924a8a7a0f9a68d372baaaa28ef28

cURL

curl -g "https://www.simpleinout.com/api/v4/users" -X GET \
	-H "Authorization: Bearer 8776c37dbbef69fb2799d812c5eb882c086924a8a7a0f9a68d372baaaa28ef28"

Response

Simulated Response

Response Fields

Name Description
users (array) an array of users
trusted_cached_at (string in the meta object) the server time minus an amount to account for network delivery time

Status

200

Headers

ETag: W/"331529b07878fc9d0bca675a984acb6c"
Last-Modified: Tue, 12 Feb 2019 19:59:12 GMT

Body

{
  "users": [
    {
      "id": "10812",
      "name": "Ashton Altenwerth",
      "email": "staceydooley@crist.biz",
      "image_url": "https://gravatar.com/avatar/ad74d104f60da4b66c2785a9e6bb4411.png?s=270\u0026d=blank",
      "details": "Reiciendis sunt nostrum.",
      "lang": "en",
      "role_id": "24991",
      "created_at": 1550001552,
      "updated_at": 1550001552,
      "cached_at": "1550001552.749485000"
    },
    {
      "id": "10811",
      "name": "Micah Roob",
      "email": "mirtamurazik@murrayleannon.co",
      "image_url": "https://gravatar.com/avatar/1513748f950ab1800bfe21fb7744b271.png?s=270\u0026d=blank",
      "details": "Reprehenderit inventore cumque.",
      "lang": "en",
      "role_id": "24991",
      "created_at": 1550001552,
      "updated_at": 1550001552,
      "cached_at": "1550001552.733233000"
    },
    {
      "id": "10810",
      "name": "Lesha Hudson",
      "email": "robby@pfannerstilltreutel.co",
      "image_url": "https://gravatar.com/avatar/b452927290f50fc3d03eabb2ac927ee8.png?s=270\u0026d=blank",
      "details": "Qui quibusdam autem.",
      "lang": "en",
      "role_id": "24991",
      "created_at": 1550001552,
      "updated_at": 1550001552,
      "cached_at": "1550001552.713072800"
    },
    {
      "id": "10809",
      "name": "Audie Klein",
      "email": "fredrickmosciski@bradtke.co",
      "image_url": "https://gravatar.com/avatar/0ca909c664d2bd8b0c43f822159ea219.png?s=270\u0026d=blank",
      "details": "Sunt ut id.",
      "lang": "en",
      "role_id": "24989",
      "created_at": 1550001552,
      "updated_at": 1550001552,
      "cached_at": "1550001552.700592000"
    }
  ],
  "meta": {
    "paging": {
      "page": 1,
      "page_size": 25,
      "page_count": 1,
      "count": 4,
      "previous_page": null,
      "next_page": null,
      "first_href": "http://example.org/api/v4/users",
      "last_href": "http://example.org/api/v4/users",
      "previous_href": null,
      "next_href": null
    },
    "last_updated_at": {
      "beacons": 1545595152,
      "favorites": 1549569552,
      "fences": 1544471952,
      "groups": 1542571152,
      "networks": 0,
      "roles": 1550001552,
      "settings": 1550001552
    },
    "trusted_cached_at": "1550001537.777333000"
  }
}

Retrieve a user

Retrieve an existing user. Users must have a role that permits viewing users.

Endpoint

GET /api/v4/users/:id

Parameters

Name Description
only (string) comma-delimited list of fields to render only, possibilities include: 'id', 'name', 'email', 'image_url', 'details', 'lang', 'created_at', 'updated_at', 'cached_at'
expand (string) comma-delimited list of extra information to include in the response, possibilities include: 'memberships', 'memberships.group', 'phones', 'status', 'status.application', 'status.changed_by_user', 'recents', 'role'

Request

Route

GET /api/v4/users/10788

Headers

Authorization: Bearer 56c2765a255c7c5f7630df648e33f3ed36dfedc810ab32f779074aa4ed111005

cURL

curl -g "https://www.simpleinout.com/api/v4/users/10788" -X GET \
	-H "Authorization: Bearer 56c2765a255c7c5f7630df648e33f3ed36dfedc810ab32f779074aa4ed111005"

Response

Simulated Response

Response Fields

Name Description
users (object) a user object

Status

200

Headers

ETag: W/"785012880999015dbbf8b6b412f952f5"
Last-Modified: Tue, 12 Feb 2019 19:59:11 GMT

Body

{
  "users": {
    "id": "10788",
    "name": "Emmett Ledner Jr.",
    "email": "edgarcollins@cremin.info",
    "image_url": "https://gravatar.com/avatar/b9872712ab41f8c79d1cf5171daa871a.png?s=270\u0026d=blank",
    "details": "Eligendi alias incidunt.",
    "lang": "en",
    "role_id": "24947",
    "created_at": 1550001551,
    "updated_at": 1550001551,
    "cached_at": "1550001551.300449100"
  },
  "meta": {
    "last_updated_at": {
      "beacons": 1541966351,
      "favorites": 1544212751,
      "fences": 1547323151,
      "groups": 1549137551,
      "networks": 0,
      "roles": 1550001551,
      "settings": 1550001551
    }
  }
}

Retrieve the current user

Retrieve the current user who is authorized.

Endpoint

GET /api/v4/users/my

Parameters

Name Description
only (string) comma-delimited list of fields to render only, possibilities include: 'id', 'name', 'email', 'image_url', 'details', 'lang', 'created_at', 'updated_at', 'cached_at'
expand (string) comma-delimited list of extra information to include in the response, possibilities include: 'memberships', 'memberships.group', 'phones', 'status', 'status.application', 'status.changed_by_user', 'recents', 'role'

Request

Route

GET /api/v4/users/my

Headers

Authorization: Bearer 0dc25e16cb8f209462b4e0ce5f7388db8852a3be14525c12909ee65cd84f2905

cURL

curl -g "https://www.simpleinout.com/api/v4/users/my" -X GET \
	-H "Authorization: Bearer 0dc25e16cb8f209462b4e0ce5f7388db8852a3be14525c12909ee65cd84f2905"

Response

Simulated Response

Response Fields

Name Description
users (object) a user object

Status

200

Headers

ETag: W/"5fe40a43d2e532526aa72961ec0ce0b3"
Last-Modified: Tue, 12 Feb 2019 19:59:12 GMT

Body

{
  "users": {
    "id": "10801",
    "name": "Wanita Barton",
    "email": "trinhorn@thompsoncrona.org",
    "image_url": "https://gravatar.com/avatar/6888d7ed2adda0b4f64fce52a7c6f4b7.png?s=270\u0026d=blank",
    "details": "Voluptatem est et.",
    "lang": "en",
    "role_id": "24975",
    "created_at": 1550001552,
    "updated_at": 1550001552,
    "cached_at": "1550001552.146286000"
  },
  "meta": {
    "last_updated_at": {
      "beacons": 1545249552,
      "favorites": 1546977552,
      "fences": 1543089552,
      "groups": 1544039952,
      "networks": 0,
      "roles": 1550001552,
      "settings": 1550001552
    }
  }
}

Unfavorite a status for the current user

Undoes a previous status’ favorite designation for the current user’s Quick Picks.

Endpoint

PATCH /api/v4/users/my/statuses/unfavorite

Parameters

Name Description
status[status] required (string) must be 'in' or 'out'
status[comment] (string) up to 50 character description of the status update

Request

Route

PATCH /api/v4/users/my/statuses/unfavorite

Headers

Authorization: Bearer c7fdd3e52527e54ad4f59ea5ab37f0897d1ce4ecb3cd35f5494453adc1b849ab

Body

status[status]=in&status[comment]=At+Lunch

cURL

curl "https://www.simpleinout.com/api/v4/users/my/statuses/unfavorite" -d 'status[status]=in&status[comment]=At+Lunch' -X PATCH \
	-H "Authorization: Bearer c7fdd3e52527e54ad4f59ea5ab37f0897d1ce4ecb3cd35f5494453adc1b849ab"

Response

Simulated Response

Status

204

Update a user

Updates an existing user. Users must have a role that permits managing the company/users to update users. Companies must have at least one user with the Administrator role, if you attempt to change the role of the last user with the Administrator role, this will result in a less_than error on the base parameter.

Endpoint

PATCH /api/v4/users/:id

Parameters

Name Description
user[email] (string) new user's email address
user[name] (string) new user's full name
user[details] (string) additional text information about the user
user[lang] (string) preferred locale of the user, can be de, en-au, en-ca, en-gb, en, es, fr-ca, fr, ja, lv, nb, nl, ru, sq, sv
user[phones_attributes] (array) phone objects to attach to the user if both 'id' and 'number' are passed in, the existing phone number will be updated if just 'number' is passed in, a new phone will be added if both 'id' and '_destroy' are passed in ('_destroy' being truthy like 'true' or '1'), the phone number will be removed
user[memberships_attributes] (array) group objects to attach to the user if both 'id' and 'group_id' are passed in, the existing membership will be updated if just 'group_id' is passed in, a new membership will be added if both 'id' and '_destroy' are passed in ('_destroy' being truthy like 'true' or '1'), the group membership will be removed
user[role_id] (string) the ID of the role to assign to the user
only (string) comma-delimited list of fields to render only, possibilities include: 'id', 'name', 'email', 'image_url', 'details', 'lang', 'created_at', 'updated_at', 'cached_at'
expand (string) comma-delimited list of extra information to include in the response, possibilities include: 'memberships', 'memberships.group', 'phones', 'status', 'status.application', 'status.changed_by_user', 'recents', 'role'

Request

Route

PATCH /api/v4/users/10814

Headers

Authorization: Bearer f8c32f3aeaf6b479f207b4f93301785f62297d94e51d14d61975be3a5e9c318b

Body

user[phones_attributes][][number]=%28270%29+630-4587+x6183&user[memberships_attributes][][group_id]=389

cURL

curl "https://www.simpleinout.com/api/v4/users/10814" -d 'user[phones_attributes][][number]=%28270%29+630-4587+x6183&user[memberships_attributes][][group_id]=389' -X PATCH \
	-H "Authorization: Bearer f8c32f3aeaf6b479f207b4f93301785f62297d94e51d14d61975be3a5e9c318b"

Response

Simulated Response

Response Fields

Name Description
users (object) the newly updated user attributes

Status

200

Headers

ETag: W/"20e483c089e8eca2f60cae9f6a076d71"

Body

{
  "users": {
    "id": "10814",
    "name": "Edna Raynor DDS",
    "email": "daiseyheel@swift.biz",
    "image_url": "https://gravatar.com/avatar/aa8e88908fc5a7699655f0db8eaee7b9.png?s=270\u0026d=blank",
    "details": "Dolores voluptatem assumenda.",
    "lang": "en",
    "role_id": "24995",
    "created_at": 1550001552,
    "updated_at": 1550001552,
    "cached_at": "1550001552.947947000"
  },
  "meta": {
    "last_updated_at": {
      "beacons": 1545940752,
      "favorites": 1549051152,
      "fences": 1546459152,
      "groups": 1550001552,
      "networks": 0,
      "roles": 1550001552,
      "settings": 1550001552
    }
  }
}

Update the current user

Updates the currently authorized user. The current user cannot update their own role.

Endpoint

PATCH /api/v4/users/my

Parameters

Name Description
user[email] (string) new user's email address
user[name] (string) new user's full name
user[details] (string) additional text information about the user
user[lang] (string) preferred locale of the user, can be de, en-au, en-ca, en-gb, en, es, fr-ca, fr, ja, lv, nb, nl, ru, sq, sv
user[phones_attributes] (array) phone objects to attach to the user if both 'id' and 'number' are passed in, the existing phone number will be updated if just 'number' is passed in, a new phone will be added if both 'id' and '_destroy' are passed in ('_destroy' being truthy like 'true' or '1'), the phone number will be removed
user[memberships_attributes] (array) group objects to attach to the user if both 'id' and 'group_id' are passed in, the existing membership will be updated if just 'group_id' is passed in, a new membership will be added if both 'id' and '_destroy' are passed in ('_destroy' being truthy like 'true' or '1') the group membership will be removed
only (string) comma-delimited list of fields to render only, possibilities include: 'id', 'name', 'email', 'image_url', 'details', 'lang', 'created_at', 'updated_at', 'cached_at'
expand (string) comma-delimited list of extra information to include in the response, possibilities include: 'memberships', 'memberships.group', 'phones', 'status', 'status.application', 'status.changed_by_user', 'recents', 'role'

Request

Route

PATCH /api/v4/users/my

Headers

Authorization: Bearer a68e399830596e7f783dc571884ddee8533148b634b2fe12f82360949f5bc96f

Body

user[phones_attributes][][number]=748-828-1837+x792&user[memberships_attributes][][group_id]=384

cURL

curl "https://www.simpleinout.com/api/v4/users/my" -d 'user[phones_attributes][][number]=748-828-1837+x792&user[memberships_attributes][][group_id]=384' -X PATCH \
	-H "Authorization: Bearer a68e399830596e7f783dc571884ddee8533148b634b2fe12f82360949f5bc96f"

Response

Simulated Response

Response Fields

Name Description
users (object) the newly updated user attributes

Status

200

Headers

ETag: W/"0274896ea4d79e0331b05edcf43bd058"

Body

{
  "users": {
    "id": "10772",
    "name": "Miss Samual Auer",
    "email": "jim@koelpin.com",
    "image_url": "https://gravatar.com/avatar/be72b87fc72b0e04c6cead2aee6bf4ab.png?s=270\u0026d=blank",
    "details": "Qui fugit ut.",
    "lang": "en",
    "role_id": "24909",
    "created_at": 1550001549,
    "updated_at": 1550001550,
    "cached_at": "1550001550.000587000"
  },
  "meta": {
    "last_updated_at": {
      "beacons": 1546977549,
      "favorites": 1544039949,
      "fences": 1541966349,
      "groups": 1550001549,
      "networks": 0,
      "roles": 1550001549,
      "settings": 1550001549
    }
  }
}