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.

Upgrading from API v3

APIv4 introduces user roles. The actions a user is permitted to perform are now determined by checking the permissions on a user’s role. For most actions, you’re no longer required to compare the company’s settings to the user’s privileges to determine if a user is allowed to perform an action.

Changes to Companies

The following attributes have been removed from companies, listed with their replacements:

  • future_visible_to: company.scheduled_statuses, user.role.view_others_futures
  • history_visible_to: user.role.view_others_archives
  • push_visible_to: company.plan.push, user.role.followed_users
  • safety_visible_to: company.plan.push, user.role.safeties
  • update_future: company.scheduled_statuses, user.role.manage_own_futures, user.role.manage_others_futures
  • update_visible: user.role.view_status_updated_at

A new attribute has been added to companies:

  • default_role_id: This identifier signals which role is considered the default role. This is the role that should be presented when adding a new user.

  • scheduled_statuses: This setting controls whether users in the company can use the scheduled statuses feature. The user’s role will determine if they can add/view scheduled statuses for themselves and/or for others if the company has scheduled statuses turned on.

Changes to Users

While the number of users returned still defaults to 25 users per request, we have capped the maximum number of users that can be requested at 100 per page. APIv3 had a similar limit on users but it was not being enforced.

The following attributes have been removed from users, listed with their replacements:

  • admin: The “Administrator” role has replaced the admin attribute. This role can perform all actions by default, including deleting the company’s account. Many permissions that were previously limited to admin users can now be assigned to non-admin roles.
  • control_self: user.role.manage_own_status
  • control_others: user.role.manage_others_status

A new attribute has been added to users:

Changes to Range Searching

When filtering past statuses and scheduled statuses by the created_at or apply_at dates, we now use epoch times instead of date strings for more control over the records returned.

In APIv3, a single date would return all records between the beginning and end of the day, so to match that, you would have to replace this with a time range for the start and end of the day.

You would change a filter for created_at=2018-01-01 to something like created_at=1514786400..1514872800. The actual epoch times will depend on your time zone. This example is in Central Time.

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%2Fokon.net&scope=write&locale=en

Query Parameters

response_type=code
client_id=PLACE_YOUR_API_CLIENT_ID_HERE
redirect_uri=https://okon.net
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%2Fokon.net&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=205fc5fdf1ef302442bd91e5866e93d9f874f553296d6f33ef2068d57209eccd&redirect_uri=https%3A%2F%2Fconn.biz

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=205fc5fdf1ef302442bd91e5866e93d9f874f553296d6f33ef2068d57209eccd&redirect_uri=https%3A%2F%2Fconn.biz' -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. The privileges object will be removed from APIv4 when APIv3 is no longer available.

Status

200

Headers

ETag: W/"7fef6acdd2f58fc1cd2ba9907afeead8"

Body

{
  "access_token": "73b2f3e70784c8461d1b8b649657e82fb8e467e267ad0118577471d95048ce92",
  "token_type": "bearer",
  "expires_in": 604800,
  "refresh_token": "527fe42f02640f74e9cf7ea9f0fd0224b09134a5a1c0c3fbdf7de06dd387ff8f",
  "scope": "write",
  "created_at": 1544032515,
  "user": {
    "id": "116",
    "privileges": {
      "admin": true,
      "control_others": true,
      "control_self": true
    },
    "roles": {
      "id": "277",
      "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": 1544032515,
      "updated_at": 1544032515
    }
  }
}

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=1zvhm1uaico827fb9emutzoy7cmiazv3

cURL

curl "https://www.simpleinout.com/oauth/token" -d 'grant_type=refresh_token&refresh_token=1zvhm1uaico827fb9emutzoy7cmiazv3' -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. The privileges object will be removed from APIv4 when APIv3 is no longer available.

Status

200

Headers

ETag: W/"ad6c117e36443b791753fbd4d330b7a7"

Body

{
  "access_token": "795593741400ea63ba86809c545a53e5c82c937c76903d6feb3f47e0db52d579",
  "token_type": "bearer",
  "expires_in": 604800,
  "refresh_token": "2c9dc52b17220a640fae9571716501f08bdb48b0a1fb492fd9c7967279c2e4ba",
  "scope": "write",
  "created_at": 1544032514,
  "user": {
    "id": "111",
    "privileges": {
      "admin": true,
      "control_others": true,
      "control_self": true
    },
    "roles": {
      "id": "265",
      "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": 1544032514,
      "updated_at": 1544032514
    }
  }
}

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=d4c6466ab90517fe7e2cb350213b4f2bdda4ab13873abc6073c32b0d36455e69

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=d4c6466ab90517fe7e2cb350213b4f2bdda4ab13873abc6073c32b0d36455e69' -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 80e4e384269c7822ef758010a8489a2cf6d7502b90f5d0b0f0c3e4bc4107debf

cURL

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

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/"6e8adf60235760210dcc31e8bebc5748"

Body

{
  "resource_owner_id": 113,
  "scopes": [
    "read"
  ],
  "expires_in_seconds": 604800,
  "application": {
    "uid": "4144674311256"
  },
  "created_at": 1544032515
}

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 34f58ead7370f27c9383e724f1a4405871be53ff17a0229a152b0410ae9ec76d

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 34f58ead7370f27c9383e724f1a4405871be53ff17a0229a152b0410ae9ec76d"

Response

Simulated Response

Response Fields

Name Description
beacons (object) the newly created beacon attributes

Status

201

Headers

ETag: W/"5f11c5766bd2db70d1189344d59adfa1"

Body

{
  "beacons": {
    "id": "4",
    "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": 1544032510,
    "updated_at": 1544032510
  },
  "meta": {
    "last_updated_at": {
      "beacons": 1540140910,
      "favorites": 1540918510,
      "fences": 1537376110,
      "groups": 1540659310,
      "networks": 0,
      "roles": 1544032510,
      "settings": 1544032510
    }
  }
}

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/5

Headers

Authorization: Bearer 408b0c3d57308d4e99fb32df50b27b47cb3c1b6d733112ddd444bbf63245f5c7

cURL

curl "https://www.simpleinout.com/api/v4/beacons/5" -d '' -X DELETE \
	-H "Authorization: Bearer 408b0c3d57308d4e99fb32df50b27b47cb3c1b6d733112ddd444bbf63245f5c7"

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 241229ae2832c7ee233c34ecfcd6f4f5e8faf4fdf8e7d70d35e297df5a07d0fb

cURL

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

Response

Simulated Response

Response Fields

Name Description
beacons (array) an array of beacons

Status

200

Headers

ETag: W/"663cef4c136f087d99554b045c948ec5"
Last-Modified: Wed, 05 Dec 2018 17:55:10 GMT

Body

{
  "beacons": [
    {
      "id": "3",
      "name": "Toy, Reichel and Hessel",
      "uuid": "125BD734-8DC3-44F3-B834-126F498C3FA6",
      "comment_on_entry": "In at Toy, Reichel and Hessel",
      "comment_on_exit": "Left Toy, Reichel and Hessel",
      "entry": true,
      "exit": true,
      "status_on_entry": "in",
      "status_on_exit": "out",
      "created_at": 1544032510,
      "updated_at": 1544032510
    },
    {
      "id": "2",
      "name": "Mayert, Schinner and Legros",
      "uuid": "73A46558-0C8F-48F1-A08C-E89CE8C0F602",
      "comment_on_entry": "In at Mayert, Schinner and Legros",
      "comment_on_exit": "Left Mayert, Schinner and Legros",
      "entry": true,
      "exit": true,
      "status_on_entry": "in",
      "status_on_exit": "out",
      "created_at": 1544032510,
      "updated_at": 1544032510
    }
  ],
  "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": 1544032510,
      "favorites": 1541699710,
      "fences": 1542218110,
      "groups": 1541440510,
      "networks": 0,
      "roles": 1544032510,
      "settings": 1544032510
    }
  }
}

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/6

Headers

Authorization: Bearer 34cd248b3f7e45b117bce583b5ed66757fbb1e329211c41e9ad150df1c218d02

Body

beacon[name]=My+Renamed+Office

cURL

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

Response

Simulated Response

Response Fields

Name Description
beacons (object) the newly updated beacon attributes

Status

200

Headers

ETag: W/"7238b3f02966e0a2b8cda353ecb87ece"

Body

{
  "beacons": {
    "id": "6",
    "name": "My Renamed Office",
    "uuid": "F6363197-CE66-44A1-8ABA-58B322A3C0DB",
    "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": 1544032511,
    "updated_at": 1544032511
  },
  "meta": {
    "last_updated_at": {
      "beacons": 1544032511,
      "favorites": 1543168511,
      "fences": 1542477311,
      "groups": 1539363311,
      "networks": 0,
      "roles": 1544032511,
      "settings": 1544032511
    }
  }
}

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 3e11068f561437224bd443b1dd746fc4d254f88573de1e0a6733ea804a13537a

cURL

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

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/"26c208c035b34486586f7369d06f5407"
Last-Modified: Wed, 05 Dec 2018 17:55:15 GMT

Body

{
  "companies": {
    "id": "73",
    "name": "Schuppe, Hodkiewicz and Rosenbaum",
    "scheduled_statuses": true,
    "default_role_id": "295",
    "logo_url": null,
    "created_at": 1544032515
  },
  "meta": {
    "last_updated_at": {
      "beacons": 1538153715,
      "favorites": 1543859715,
      "fences": 1539017715,
      "groups": 1536252915,
      "networks": 0,
      "roles": 1544032515,
      "settings": 1544032515
    }
  }
}

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/7

Headers

Authorization: Bearer 8fca12bb44009aab07a4d7997315f0c13f19cece2e3333fba159caa6524012a2

cURL

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

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 c392d515c0eb4bfeb85ca9e7feed21fbc76f910c279f640499113f3b4bcdced0

cURL

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

Response

Simulated Response

Response Fields

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

Status

200

Headers

ETag: W/"4201d69231e1b74b95144e6190182ed7"
Last-Modified: Wed, 05 Dec 2018 17:55:15 GMT

Body

{
  "futures": [
    {
      "id": "8",
      "status": "out",
      "comment": "On Vacation, back Monday",
      "apply_at": 1546707600,
      "user_id": "121",
      "changed_by_user_id": null
    },
    {
      "id": "9",
      "status": "out",
      "comment": "At the conference this week",
      "apply_at": 1559750400,
      "user_id": "121",
      "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": 1536857715,
      "favorites": 1540054515,
      "fences": 1543254915,
      "groups": 1535561715,
      "networks": 0,
      "roles": 1544032515,
      "settings": 1544032515
    }
  }
}

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[entry] required (boolean) indicates whether a fence should trigger a status update upon entry
fence[exit] required (boolean) indicates whether a fence should trigger a status update upon exit

Request

Route

POST /api/v4/fences

Headers

Authorization: Bearer 0d6e7692c222058c94dfaf224f8d0806e825e35a6eed06f5167a74dc437fa214

Body

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

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&fence[entry]=true&fence[exit]=true' -X POST \
	-H "Authorization: Bearer 0d6e7692c222058c94dfaf224f8d0806e825e35a6eed06f5167a74dc437fa214"

Response

Simulated Response

Response Fields

Name Description
fences (object) the newly created fence attributes

Status

201

Headers

ETag: W/"bc694c5945a703e6b28ac6ac31334b5d"

Body

{
  "fences": {
    "id": "2",
    "name": "My Office",
    "radius": 150,
    "latitude": "46.877931",
    "longitude": "-96.787459",
    "entry": true,
    "exit": true,
    "created_at": 1544032510,
    "updated_at": 1544032510
  },
  "meta": {
    "last_updated_at": {
      "beacons": 1542909310,
      "favorites": 1540832110,
      "fences": 1544032510,
      "groups": 1537894510,
      "networks": 0,
      "roles": 1544032510,
      "settings": 1544032510
    }
  }
}

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/1

Headers

Authorization: Bearer e47b172a541cc531b49d2c527855826ddcbee4ea126ace460b92deaea45fdb2c

cURL

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

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 abd6e797f89df702e1bf3c4ac3e21c5cc821c0eb2cec08da0191308ef934ed82

cURL

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

Response

Simulated Response

Response Fields

Name Description
fences (array) an array of fences

Status

200

Headers

ETag: W/"6d496cde70e035fed78f2b9c8ba26b50"
Last-Modified: Wed, 05 Dec 2018 17:55:10 GMT

Body

{
  "fences": [
    {
      "id": "5",
      "name": "bnzl5jqyr5yytkerky6e",
      "radius": 5,
      "latitude": "11.6563617106",
      "longitude": "-19.1207212371",
      "entry": true,
      "exit": true,
      "created_at": 1544032510,
      "updated_at": 1544032510
    },
    {
      "id": "4",
      "name": "9yokbzl9bp1uqyktw1m2",
      "radius": 2,
      "latitude": "3.0967234129",
      "longitude": "-124.1591326281",
      "entry": true,
      "exit": true,
      "created_at": 1544032510,
      "updated_at": 1544032510
    }
  ],
  "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": 1538153710,
      "favorites": 1537635310,
      "fences": 1544032510,
      "groups": 1537548910,
      "networks": 0,
      "roles": 1544032510,
      "settings": 1544032510
    }
  }
}

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[entry] (boolean) indicates whether a fence should trigger a status update upon entry
fence[exit] (boolean) indicates whether a fence should trigger a status update upon exit

Request

Route

PATCH /api/v4/fences/3

Headers

Authorization: Bearer 6f526a29a0235fd9208b0e21b698d0098d633b7eb6e1ee877e30702e64961897

Body

fence[name]=My+Renamed+Geofence

cURL

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

Response

Simulated Response

Response Fields

Name Description
fences (object) the newly updated fence attributes

Status

200

Headers

ETag: W/"f3131d5db7f34764a793aaf3153e3d58"

Body

{
  "fences": {
    "id": "3",
    "name": "My Renamed Geofence",
    "radius": 5,
    "latitude": "58.3231886274",
    "longitude": "-2.3111790062",
    "entry": true,
    "exit": true,
    "created_at": 1544032510,
    "updated_at": 1544032510
  },
  "meta": {
    "last_updated_at": {
      "beacons": 1539881710,
      "favorites": 1539449710,
      "fences": 1544032510,
      "groups": 1539017710,
      "networks": 0,
      "roles": 1544032510,
      "settings": 1544032510
    }
  }
}

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 f2196ea54d58d7f82be4d625494eca14f6cbea88ba06feaa6200c0ae52604dff

Body

group[name]=New+Department

cURL

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

Response

Simulated Response

Response Fields

Name Description
groups (object) the newly created group attributes

Status

201

Headers

ETag: W/"389eb17ad9a9024386da8f02b4b96fb0"

Body

{
  "groups": {
    "id": "4",
    "name": "New Department"
  },
  "meta": {
    "last_updated_at": {
      "beacons": 1542218108,
      "favorites": 1542131708,
      "fences": 1536944108,
      "groups": 1544032509,
      "networks": 0,
      "roles": 1544032509,
      "settings": 1544032509
    }
  }
}

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/3

Headers

Authorization: Bearer dcb5a8254376b5b4a508c7105a3ed1cc3d6f034e38ffa294f1da10a6421a0c73

cURL

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

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 13c9b44cd0eb8a5d8382225db345718dde9b700209c340bed0befb95306f0cee

cURL

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

Response

Simulated Response

Response Fields

Name Description
groups (array) an array of groups

Status

200

Headers

ETag: W/"3c4326e3b6fd9b45172acdf46f01f847"
Last-Modified: Wed, 05 Dec 2018 17:55:08 GMT

Body

{
  "groups": [
    {
      "id": "2",
      "name": "Nicolas and Sons"
    },
    {
      "id": "1",
      "name": "Runolfsson-Smitham"
    }
  ],
  "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": 1540832108,
      "favorites": 1538412908,
      "fences": 1537289708,
      "groups": 1544032508,
      "networks": 0,
      "roles": 1544032508,
      "settings": 1544032508
    }
  }
}

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/5

Headers

Authorization: Bearer a6f79c661a5ee08fc4f63f7db89375a1bfa858491d0073595284b8809cedf8fa

Body

group[name]=Renamed+Department

cURL

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

Response

Simulated Response

Response Fields

Name Description
groups (object) the newly updated group attributes

Status

200

Headers

ETag: W/"c69f06b9e35a685f9c9a7431362cf56c"

Body

{
  "groups": {
    "id": "5",
    "name": "Renamed Department"
  },
  "meta": {
    "last_updated_at": {
      "beacons": 1536512109,
      "favorites": 1539449709,
      "fences": 1542045309,
      "groups": 1544032509,
      "networks": 0,
      "roles": 1544032509,
      "settings": 1544032509
    }
  }
}

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 bd261a591bfaf5a828c3bce05a0812b498c500e668a124ad21e161f038462ed5

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 bd261a591bfaf5a828c3bce05a0812b498c500e668a124ad21e161f038462ed5"

Response

Simulated Response

Response Fields

Name Description
networks (object) the newly created network attributes

Status

201

Headers

ETag: W/"d1d2164ad8043ddc0741374a94dc0f06"

Body

{
  "networks": {
    "id": "5",
    "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": 1544032511,
    "updated_at": 1544032511
  },
  "meta": {
    "last_updated_at": {
      "beacons": 1540918511,
      "favorites": 1543859711,
      "fences": 1539622511,
      "groups": 1541091311,
      "networks": 0,
      "roles": 1544032511,
      "settings": 1544032511
    }
  }
}

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/1

Headers

Authorization: Bearer 12c27d663d51357208669cb40b2166ad78b9309b7755d46da4ba67f8c722cb70

cURL

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

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 4538d3a2712ed9fda76c9b8e113ae53ad2be07c5d86723d64d59740aa0993158

cURL

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

Response

Simulated Response

Response Fields

Name Description
networks (array) an array of networks

Status

200

Headers

ETag: W/"7e48742d923e61a494763ee05dd21638"
Last-Modified: Wed, 05 Dec 2018 17:55:11 GMT

Body

{
  "networks": [
    {
      "id": "2",
      "name": "Casper and Sons",
      "ssid": "pej6ql9gtkc07fli23c6f04u3vtitd19",
      "comment_on_entry": "In at Casper and Sons",
      "comment_on_exit": "Left Casper and Sons",
      "entry": true,
      "exit": true,
      "status_on_entry": "in",
      "status_on_exit": "out",
      "created_at": 1544032511,
      "updated_at": 1544032511
    },
    {
      "id": "3",
      "name": "Von Inc",
      "ssid": "73piweo6p8cy704ce0x5u4mlml5vs06q",
      "comment_on_entry": "In at Von Inc",
      "comment_on_exit": "Left Von Inc",
      "entry": true,
      "exit": true,
      "status_on_entry": "in",
      "status_on_exit": "out",
      "created_at": 1544032511,
      "updated_at": 1544032511
    }
  ],
  "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": 1539363311,
      "favorites": 1540400111,
      "fences": 1540659311,
      "groups": 1537808111,
      "networks": 1544032511,
      "roles": 1544032511,
      "settings": 1544032511
    }
  }
}

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/4

Headers

Authorization: Bearer 74e9daa84e1c75ce3c57e049019e8fff0f46923e0fabb6e2ee78fa88a0f2c988

Body

network[name]=My+Renamed+Office

cURL

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

Response

Simulated Response

Response Fields

Name Description
networks (object) the newly updated network attributes

Status

200

Headers

ETag: W/"355bfe2cb41865115629e698a6bc36e2"

Body

{
  "networks": {
    "id": "4",
    "name": "My Renamed Office",
    "ssid": "ta8z78bqgu8gnm2xb70j0wsfbggan8nh",
    "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": 1544032511,
    "updated_at": 1544032511
  },
  "meta": {
    "last_updated_at": {
      "beacons": 1538758511,
      "favorites": 1538326511,
      "fences": 1538931311,
      "groups": 1540227311,
      "networks": 1544032511,
      "roles": 1544032511,
      "settings": 1544032511
    }
  }
}

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 cc776378f5743624b16ff6336d5ebe82dbf5e0dc42b547f6154a8826246028e9

cURL

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

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 2a1ae92aac44db577686a400de21bbeed4b935cce5ec21d8d53de1d150558eff

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 2a1ae92aac44db577686a400de21bbeed4b935cce5ec21d8d53de1d150558eff"

Response

Simulated Response

Response Fields

Name Description
roles (object) the newly created role attributes

Status

201

Headers

ETag: W/"b4b5afaec11176485463364d74614eaf"

Body

{
  "roles": {
    "id": "14",
    "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": 1544032506,
    "updated_at": 1544032506
  },
  "meta": {
    "last_updated_at": {
      "beacons": 1538499306,
      "favorites": 1535993706,
      "fences": 1542736506,
      "groups": 1535907306,
      "networks": 0,
      "roles": 1544032506,
      "settings": 1544032506
    }
  }
}

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/9

Headers

Authorization: Bearer 0355cc78c5844c610435639cb80e24956ae4814a8a71970a05db86e5cf4e7318

cURL

curl "https://www.simpleinout.com/api/v4/roles/9" -d '' -X DELETE \
	-H "Authorization: Bearer 0355cc78c5844c610435639cb80e24956ae4814a8a71970a05db86e5cf4e7318"

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 912d7a6af4df0f320e57296d0606c8902ae59192dd3a5d9188cff41f402a5bad

cURL

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

Response

Simulated Response

Response Fields

Name Description
roles (array) an array of roles

Status

200

Headers

ETag: W/"d0a92dd28ea54965bd3cbea2409bf3e9"
Last-Modified: Wed, 05 Dec 2018 17:55:05 GMT

Body

{
  "roles": [
    {
      "id": "1",
      "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": 1544032505,
      "updated_at": 1544032505
    },
    {
      "id": "2",
      "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": 1544032505,
      "updated_at": 1544032505
    },
    {
      "id": "3",
      "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": 1544032505,
      "updated_at": 1544032505
    },
    {
      "id": "4",
      "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": 1544032505,
      "updated_at": 1544032505
    }
  ],
  "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": 1541264105,
      "favorites": 1542218105,
      "fences": 1538153705,
      "groups": 1539449705,
      "networks": 0,
      "roles": 1544032505,
      "settings": 1544032505
    }
  }
}

Retrieve a role

Retrieve an existing role.

Endpoint

GET /api/v4/roles/:id

Request

Route

GET /api/v4/roles/24

Headers

Authorization: Bearer 5751d273084d7d2662c450e25d7ed3a4f2cbaca383b18f5d79c8369ad2bff55e

cURL

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

Response

Simulated Response

Response Fields

Name Description
roles (object) the role attributes

Status

200

Headers

ETag: W/"5d3eada173a815fe0f1c88f85b554526"
Last-Modified: Wed, 05 Dec 2018 17:55:06 GMT

Body

{
  "roles": {
    "id": "24",
    "name": "Kling Inc",
    "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": 1544032506,
    "updated_at": 1544032506
  },
  "meta": {
    "last_updated_at": {
      "beacons": 1542045306,
      "favorites": 1538931306,
      "fences": 1537548906,
      "groups": 1541354106,
      "networks": 0,
      "roles": 1544032506,
      "settings": 1544032506
    },
    "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/19

Headers

Authorization: Bearer 4a670ea3a0696f4ec49c06b8b30898c47f938d401469ae0b11d5e8bc0c737914

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/19" -d 'role[name]=My+Renamed+Role&role[billing]=false&role[view_others_archives]=true&role[view_others_futures]=true' -X PATCH \
	-H "Authorization: Bearer 4a670ea3a0696f4ec49c06b8b30898c47f938d401469ae0b11d5e8bc0c737914"

Response

Simulated Response

Response Fields

Name Description
roles (object) the newly updated role attributes

Status

200

Headers

ETag: W/"83e49673e6fb52d4ef4b36c53b0a5f60"

Body

{
  "roles": {
    "id": "19",
    "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": 1544032506,
    "updated_at": 1544032506
  },
  "meta": {
    "last_updated_at": {
      "beacons": 1535734506,
      "favorites": 1541354106,
      "fences": 1540400106,
      "groups": 1542563706,
      "networks": 0,
      "roles": 1544032506,
      "settings": 1544032506
    }
  }
}

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=1543384800..1543643999

Headers

Authorization: Bearer 2574a055bc311fe251fad37542e43b2af874f3598d6524f49c6ff57c68d40a5a

Query Parameters

created_at=1543384800..1543643999

cURL

curl -g "https://www.simpleinout.com/api/v4/statuses?created_at=1543384800..1543643999" -X GET \
	-H "Authorization: Bearer 2574a055bc311fe251fad37542e43b2af874f3598d6524f49c6ff57c68d40a5a"

Response

Simulated Response

Response Fields

Name Description
statuses (array) an array of matching statuses

Status

200

Headers

ETag: W/"ba9eeb96260461517c3e4b9816b3daad"
Last-Modified: Thu, 29 Nov 2018 15:00:00 GMT

Body

{
  "statuses": [
    {
      "status": "in",
      "comment": "At Work",
      "user_id": "132",
      "changed_by_user_id": null,
      "created_at": 1543392000
    },
    {
      "status": "out",
      "comment": "Left Work",
      "user_id": "132",
      "changed_by_user_id": null,
      "created_at": 1543406400
    },
    {
      "status": "in",
      "comment": "At Work",
      "user_id": "132",
      "changed_by_user_id": null,
      "created_at": 1543410000
    },
    {
      "status": "out",
      "comment": "Left Work",
      "user_id": "132",
      "changed_by_user_id": null,
      "created_at": 1543428000
    },
    {
      "status": "in",
      "comment": "At Work",
      "user_id": "132",
      "changed_by_user_id": null,
      "created_at": 1543478400
    },
    {
      "status": "out",
      "comment": "Left Work",
      "user_id": "132",
      "changed_by_user_id": null,
      "created_at": 1543500000
    },
    {
      "status": "out",
      "comment": "On Vacation",
      "user_id": "132",
      "changed_by_user_id": "133",
      "created_at": 1543503600
    }
  ],
  "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=1543384800..1543643999",
      "last_href": "http://example.org/api/v4/statuses?created_at=1543384800..1543643999",
      "previous_href": null,
      "next_href": null
    },
    "last_updated_at": {
      "beacons": 1537030516,
      "favorites": 1535820916,
      "fences": 1536425716,
      "groups": 1540918516,
      "networks": 0,
      "roles": 1544032516,
      "settings": 1544032516
    }
  }
}

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/106/futures

Headers

Authorization: Bearer a34bd69ea4e62a3f50b80dbbde27156354de7274eb6bdbd00e4918326c406c66

Body

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

cURL

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

Response

Simulated Response

Response Fields

Name Description
futures (object) the newly created future object

Status

201

Headers

ETag: W/"6910d5ae3fcfda72e27e4930f7d85921"

Body

{
  "futures": {
    "id": "6",
    "status": "out",
    "comment": "On Vacation",
    "apply_at": 1549386000,
    "user_id": "106",
    "changed_by_user_id": "105"
  },
  "meta": {
    "last_updated_at": {
      "beacons": 1542390914,
      "favorites": 1536598514,
      "fences": 1540227314,
      "groups": 1540659314,
      "networks": 0,
      "roles": 1544032514,
      "settings": 1544032514
    }
  }
}

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 0b642a86117c572c6e7423bdf89825c5233e3cc21816a8a84292a7ec42de3202

Body

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

cURL

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

Response

Simulated Response

Response Fields

Name Description
futures (object) the newly created future object

Status

201

Headers

ETag: W/"f5b6b14735606bd4f031c941bd7916f2"

Body

{
  "futures": {
    "id": "5",
    "status": "out",
    "comment": "On Vacation",
    "apply_at": 1549386000,
    "user_id": "98",
    "changed_by_user_id": null
  },
  "meta": {
    "last_updated_at": {
      "beacons": 1542822914,
      "favorites": 1537289714,
      "fences": 1536598514,
      "groups": 1540832114,
      "networks": 0,
      "roles": 1544032514,
      "settings": 1544032514
    }
  }
}

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/104/statuses

Headers

Authorization: Bearer 1df01ac19402eda38d908346b9687a894b1b88638f53b2661b7655808b2070a1

Body

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

cURL

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

Response

Simulated Response

Response Fields

Name Description
statuses (object) the newly created status object

Status

201

Headers

ETag: W/"ebdd8a118784c9e2b67957aa1de44ab3"

Body

{
  "statuses": {
    "status": "in",
    "comment": "In at HQ",
    "user_id": "104",
    "changed_by_user_id": "103",
    "created_at": 1544032514
  },
  "meta": {
    "last_updated_at": {
      "beacons": 1541177714,
      "favorites": 1537203314,
      "fences": 1536425714,
      "groups": 1535475314,
      "networks": 0,
      "roles": 1544032514,
      "settings": 1544032514
    }
  }
}

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 0e1ba0f6e78edb65134cd1765a8c1ffa2cba2e8e3d7b523996c1139af2153067

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 0e1ba0f6e78edb65134cd1765a8c1ffa2cba2e8e3d7b523996c1139af2153067"

Response

Simulated Response

Response Fields

Name Description
statuses (object) the newly created status object

Status

201

Headers

ETag: W/"aa1d75a7c54a3b08b5235775ac756834"

Body

{
  "statuses": {
    "status": "in",
    "comment": "In at HQ",
    "user_id": "97",
    "changed_by_user_id": null,
    "created_at": 1544032514
  },
  "meta": {
    "last_updated_at": {
      "beacons": 1537808113,
      "favorites": 1543514113,
      "fences": 1539363313,
      "groups": 1538153713,
      "networks": 0,
      "roles": 1544032513,
      "settings": 1544032513
    }
  }
}

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 66deba0e4e5c0d42e9170b61fa39635bcf7a1533cfd7630c0181a7360fc6ff31

Body

user[email]=bojack%40horsinaround.com&user[name]=Bojack+Horseman&user[details]=Lead+Actor&user[lang]=en&user[phones_attributes][][number]=309.164.1311+x303&user[memberships_attributes][][group_id]=10&user[role_id]=205

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]=309.164.1311+x303&user[memberships_attributes][][group_id]=10&user[role_id]=205' -X POST \
	-H "Authorization: Bearer 66deba0e4e5c0d42e9170b61fa39635bcf7a1533cfd7630c0181a7360fc6ff31"

Response

Simulated Response

Response Fields

Name Description
users (object) the newly created user object

Status

201

Headers

ETag: W/"5aa6c6defe2f72725443da1a105281a2"

Body

{
  "users": {
    "id": "84",
    "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": "205",
    "created_at": 1544032512,
    "updated_at": 1544032512,
    "cached_at": "1544032512.962377000"
  },
  "meta": {
    "last_updated_at": {
      "beacons": 1542563712,
      "favorites": 1537808112,
      "fences": 1538153712,
      "groups": 1544032512,
      "networks": 0,
      "roles": 1544032512,
      "settings": 1544032512
    }
  }
}

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/73

Headers

Authorization: Bearer a8bc5ca9e4da94a2162105dca09719999c200f937d352b2e977d81c10b8bc322

cURL

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

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 a09b825e5bb81df0eacb94bf8d8d605d83ca96e6f47a460b517d8db620ac70a9

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 a09b825e5bb81df0eacb94bf8d8d605d83ca96e6f47a460b517d8db620ac70a9"

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 f15ebd52d9c8ee1b439fd71898b3280e35ea0a289d0de7355ede4cabc316ea4c

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 f15ebd52d9c8ee1b439fd71898b3280e35ea0a289d0de7355ede4cabc316ea4c"

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/85/futures

Headers

Authorization: Bearer 1296c08ba7949a6ff56347fd2ec72ef5365b596df681e7631e8e3d584d2c2d97

cURL

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

Response

Simulated Response

Response Fields

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

Status

200

Headers

ETag: W/"0bf1fd5ab34c76b96b8baa583218d2bf"
Last-Modified: Wed, 05 Dec 2018 17:55:13 GMT

Body

{
  "futures": [
    {
      "id": "3",
      "status": "out",
      "comment": "Offsite Meeting",
      "apply_at": 1544601600,
      "user_id": "85",
      "changed_by_user_id": null
    },
    {
      "id": "4",
      "status": "out",
      "comment": "Gone Fishing",
      "apply_at": 1550059200,
      "user_id": "85",
      "changed_by_user_id": "86"
    }
  ],
  "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/85/futures?user_id=85",
      "last_href": "http://example.org/api/v4/users/85/futures?user_id=85",
      "previous_href": null,
      "next_href": null
    },
    "last_updated_at": {
      "beacons": 1541091312,
      "favorites": 1537462512,
      "fences": 1542390912,
      "groups": 1535993712,
      "networks": 0,
      "roles": 1544032513,
      "settings": 1544032513
    }
  }
}

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 3a8b6faebe692e40cbcf707c48cdbce8e7b87f2c0e01f64030a912f1be8286d0

cURL

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

Response

Simulated Response

Response Fields

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

Status

200

Headers

ETag: W/"dc8352a87deaec49e0fa2c1236cc9680"
Last-Modified: Wed, 05 Dec 2018 17:55:11 GMT

Body

{
  "futures": [
    {
      "id": "1",
      "status": "out",
      "comment": "Offsite Meeting",
      "apply_at": 1544601600,
      "user_id": "65",
      "changed_by_user_id": null
    },
    {
      "id": "2",
      "status": "out",
      "comment": "Gone Fishing",
      "apply_at": 1550059200,
      "user_id": "65",
      "changed_by_user_id": "66"
    }
  ],
  "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=65",
      "last_href": "http://example.org/api/v4/users/my/futures?user_id=65",
      "previous_href": null,
      "next_href": null
    },
    "last_updated_at": {
      "beacons": 1541354111,
      "favorites": 1543773311,
      "fences": 1542218111,
      "groups": 1543254911,
      "networks": 0,
      "roles": 1544032511,
      "settings": 1544032511
    }
  }
}

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/87/statuses?created_at=1543384800..1543643999

Headers

Authorization: Bearer 2932cb487f5e6d9167138190721abde4ce6441080f9296a264802bb2d8da0963

Query Parameters

created_at=1543384800..1543643999

cURL

curl -g "https://www.simpleinout.com/api/v4/users/87/statuses?created_at=1543384800..1543643999" -X GET \
	-H "Authorization: Bearer 2932cb487f5e6d9167138190721abde4ce6441080f9296a264802bb2d8da0963"

Response

Simulated Response

Response Fields

Name Description
statuses (array) an array of matching statuses

Status

200

Headers

ETag: W/"1463c168b0dbd82ce11c71dc8d4d0575"
Last-Modified: Thu, 29 Nov 2018 15:00:00 GMT

Body

{
  "statuses": [
    {
      "status": "in",
      "comment": "At Work",
      "user_id": "87",
      "changed_by_user_id": null,
      "created_at": 1543392000
    },
    {
      "status": "out",
      "comment": "Left Work",
      "user_id": "87",
      "changed_by_user_id": null,
      "created_at": 1543406400
    },
    {
      "status": "in",
      "comment": "At Work",
      "user_id": "87",
      "changed_by_user_id": null,
      "created_at": 1543410000
    },
    {
      "status": "out",
      "comment": "Left Work",
      "user_id": "87",
      "changed_by_user_id": null,
      "created_at": 1543428000
    },
    {
      "status": "in",
      "comment": "At Work",
      "user_id": "87",
      "changed_by_user_id": null,
      "created_at": 1543478400
    },
    {
      "status": "out",
      "comment": "Left Work",
      "user_id": "87",
      "changed_by_user_id": null,
      "created_at": 1543500000
    },
    {
      "status": "out",
      "comment": "Vacation",
      "user_id": "87",
      "changed_by_user_id": "88",
      "created_at": 1543503600
    }
  ],
  "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/87/statuses?created_at=1543384800..1543643999\u0026user_id=87",
      "last_href": "http://example.org/api/v4/users/87/statuses?created_at=1543384800..1543643999\u0026user_id=87",
      "previous_href": null,
      "next_href": null
    },
    "last_updated_at": {
      "beacons": 1539017713,
      "favorites": 1541004913,
      "fences": 1542995713,
      "groups": 1540745713,
      "networks": 0,
      "roles": 1544032513,
      "settings": 1544032513
    }
  }
}

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=1543384800..1543643999

Headers

Authorization: Bearer af662046d852a3f23127837cf59bc23aa236cca9d95b90ab71bcd23ac1a86c18

Query Parameters

created_at=1543384800..1543643999

cURL

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

Response

Simulated Response

Response Fields

Name Description
statuses (array) an array of matching statuses

Status

200

Headers

ETag: W/"40ce97af9038ddfb092baa1096e1a1bd"
Last-Modified: Thu, 29 Nov 2018 15:00:00 GMT

Body

{
  "statuses": [
    {
      "status": "in",
      "comment": "At Work",
      "user_id": "90",
      "changed_by_user_id": null,
      "created_at": 1543392000
    },
    {
      "status": "out",
      "comment": "Left Work",
      "user_id": "90",
      "changed_by_user_id": null,
      "created_at": 1543406400
    },
    {
      "status": "in",
      "comment": "At Work",
      "user_id": "90",
      "changed_by_user_id": null,
      "created_at": 1543410000
    },
    {
      "status": "out",
      "comment": "Left Work",
      "user_id": "90",
      "changed_by_user_id": null,
      "created_at": 1543428000
    },
    {
      "status": "in",
      "comment": "At Work",
      "user_id": "90",
      "changed_by_user_id": null,
      "created_at": 1543478400
    },
    {
      "status": "out",
      "comment": "Left Work",
      "user_id": "90",
      "changed_by_user_id": null,
      "created_at": 1543500000
    },
    {
      "status": "out",
      "comment": "Vacation",
      "user_id": "90",
      "changed_by_user_id": "91",
      "created_at": 1543503600
    }
  ],
  "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=1543384800..1543643999\u0026user_id=90",
      "last_href": "http://example.org/api/v4/users/my/statuses?created_at=1543384800..1543643999\u0026user_id=90",
      "previous_href": null,
      "next_href": null
    },
    "last_updated_at": {
      "beacons": 1539708913,
      "favorites": 1543514113,
      "fences": 1538672113,
      "groups": 1542909313,
      "networks": 0,
      "roles": 1544032513,
      "settings": 1544032513
    }
  }
}

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 2279385d3638866a794e7fc6619f40e90729211103cc79700c20fa36c6722fb5

cURL

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

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/"c3c72a9c0963e090ab2ccd689f1b723d"
Last-Modified: Wed, 05 Dec 2018 17:55:12 GMT

Body

{
  "users": [
    {
      "id": "78",
      "name": "Mr. Peggie Parisian",
      "email": "rowan_erdman@schuppe.info",
      "image_url": "https://gravatar.com/avatar/423775e1a3d20ec7ee5ec53011fc345c.png?s=270\u0026d=blank",
      "details": "Laborum aut consequatur maiores.",
      "lang": "en",
      "role_id": "195",
      "created_at": 1544032512,
      "updated_at": 1544032512,
      "cached_at": "1544032512.531528000"
    },
    {
      "id": "77",
      "name": "Meaghan Beer",
      "email": "max@tremblaycremin.biz",
      "image_url": "https://gravatar.com/avatar/204720e5bf6c65bc8201c9505b740e86.png?s=270\u0026d=blank",
      "details": "Optio asperiores perferendis excepturi.",
      "lang": "en",
      "role_id": "195",
      "created_at": 1544032512,
      "updated_at": 1544032512,
      "cached_at": "1544032512.514982000"
    },
    {
      "id": "76",
      "name": "Marley Kessler",
      "email": "eloisa.borer@mooremiller.io",
      "image_url": "https://gravatar.com/avatar/382a6fed2b277fc90c02a361358cde6f.png?s=270\u0026d=blank",
      "details": "Aut totam nostrum libero quasi.",
      "lang": "en",
      "role_id": "195",
      "created_at": 1544032512,
      "updated_at": 1544032512,
      "cached_at": "1544032512.493867000"
    },
    {
      "id": "75",
      "name": "Tillman Harris",
      "email": "fletcher_olson@maggioprohaska.io",
      "image_url": "https://gravatar.com/avatar/9aac585bf38e4386a79a3a4b0a416329.png?s=270\u0026d=blank",
      "details": "Aut illo sit quos praesentium.",
      "lang": "en",
      "role_id": "193",
      "created_at": 1544032512,
      "updated_at": 1544032512,
      "cached_at": "1544032512.479909200"
    }
  ],
  "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": 1538499312,
      "favorites": 1541177712,
      "fences": 1542131712,
      "groups": 1536857712,
      "networks": 0,
      "roles": 1544032512,
      "settings": 1544032512
    },
    "trusted_cached_at": "1544032497.554553000"
  }
}

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/108

Headers

Authorization: Bearer 6e048b2f0e0cb43f2ac5801724f5514ed52ae80838ad9ff4aa46e77d0453476a

cURL

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

Response

Simulated Response

Response Fields

Name Description
users (object) a user object

Status

200

Headers

ETag: W/"010160115109a49ebe3493d5c7c48884"
Last-Modified: Wed, 05 Dec 2018 17:55:14 GMT

Body

{
  "users": {
    "id": "108",
    "name": "Marcelle Hartmann DVM",
    "email": "joanne_bogisich@renner.info",
    "image_url": "https://gravatar.com/avatar/e9c090c3cb6e4938ad6b90e696d4db1c.png?s=270\u0026d=blank",
    "details": "Incidunt modi doloribus ut laborum.",
    "lang": "en",
    "role_id": "259",
    "created_at": 1544032514,
    "updated_at": 1544032514,
    "cached_at": "1544032514.673441000"
  },
  "meta": {
    "last_updated_at": {
      "beacons": 1536425714,
      "favorites": 1541958914,
      "fences": 1542304514,
      "groups": 1543341314,
      "networks": 0,
      "roles": 1544032514,
      "settings": 1544032514
    }
  }
}

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 4a6c49e1b4f3a5f4f705c9db37ee8960896f84ac7c26a740d945082d84d3cb34

cURL

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

Response

Simulated Response

Response Fields

Name Description
users (object) a user object

Status

200

Headers

ETag: W/"301403034d292e0bd1cd2f62d97f1dea"
Last-Modified: Wed, 05 Dec 2018 17:55:14 GMT

Body

{
  "users": {
    "id": "102",
    "name": "Ali Cummings",
    "email": "breanna@botsford.com",
    "image_url": "https://gravatar.com/avatar/a7cfcc550d44e011c647b505fb41a4bc.png?s=270\u0026d=blank",
    "details": "Eius nobis quia enim quo.",
    "lang": "en",
    "role_id": "247",
    "created_at": 1544032514,
    "updated_at": 1544032514,
    "cached_at": "1544032514.320346000"
  },
  "meta": {
    "last_updated_at": {
      "beacons": 1541177714,
      "favorites": 1536512114,
      "fences": 1543082114,
      "groups": 1536339314,
      "networks": 0,
      "roles": 1544032514,
      "settings": 1544032514
    }
  }
}

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 f7b5e72e00a69ced24d59ceaa27e2140dc8a4b8b0b750f0218d465f6f5e3f305

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 f7b5e72e00a69ced24d59ceaa27e2140dc8a4b8b0b750f0218d465f6f5e3f305"

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/80

Headers

Authorization: Bearer de1c02a43786a2e86f886832ac1a96221e1915a821aa3cde14366b429ee67d97

Body

user[phones_attributes][][number]=%28666%29+318-4270&user[memberships_attributes][][group_id]=9

cURL

curl "https://www.simpleinout.com/api/v4/users/80" -d 'user[phones_attributes][][number]=%28666%29+318-4270&user[memberships_attributes][][group_id]=9' -X PATCH \
	-H "Authorization: Bearer de1c02a43786a2e86f886832ac1a96221e1915a821aa3cde14366b429ee67d97"

Response

Simulated Response

Response Fields

Name Description
users (object) the newly updated user attributes

Status

200

Headers

ETag: W/"175f7c67092ec9b41a8e9836ba34ff31"

Body

{
  "users": {
    "id": "80",
    "name": "Kianna Christiansen",
    "email": "marjory_daniel@bechtelaraufderhar.com",
    "image_url": "https://gravatar.com/avatar/2731ec5acbbb50ce642b4cdbe9fbd8c3.png?s=270\u0026d=blank",
    "details": "Delectus vitae quis nam.",
    "lang": "en",
    "role_id": "199",
    "created_at": 1544032512,
    "updated_at": 1544032512,
    "cached_at": "1544032512.729596000"
  },
  "meta": {
    "last_updated_at": {
      "beacons": 1536944112,
      "favorites": 1542563712,
      "fences": 1541354112,
      "groups": 1544032512,
      "networks": 0,
      "roles": 1544032512,
      "settings": 1544032512
    }
  }
}

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 ec90c62139e7304b012d4ba5d6f1610b1c84e3147994c9c655a93d413ff5aad2

Body

user[phones_attributes][][number]=266.451.6365&user[memberships_attributes][][group_id]=7

cURL

curl "https://www.simpleinout.com/api/v4/users/my" -d 'user[phones_attributes][][number]=266.451.6365&user[memberships_attributes][][group_id]=7' -X PATCH \
	-H "Authorization: Bearer ec90c62139e7304b012d4ba5d6f1610b1c84e3147994c9c655a93d413ff5aad2"

Response

Simulated Response

Response Fields

Name Description
users (object) the newly updated user attributes

Status

200

Headers

ETag: W/"06381dd6e609a73fd87a15b5de5874b8"

Body

{
  "users": {
    "id": "71",
    "name": "Megane Weber",
    "email": "hilma@gislasonnikolaus.biz",
    "image_url": "https://gravatar.com/avatar/9a287decb991c875e37abd124684ed11.png?s=270\u0026d=blank",
    "details": "Nesciunt consequuntur sed distinctio et.",
    "lang": "en",
    "role_id": "181",
    "created_at": 1544032512,
    "updated_at": 1544032512,
    "cached_at": "1544032512.164106000"
  },
  "meta": {
    "last_updated_at": {
      "beacons": 1539881712,
      "favorites": 1539449712,
      "fences": 1539190512,
      "groups": 1544032512,
      "networks": 0,
      "roles": 1544032512,
      "settings": 1544032512
    }
  }
}