Version: 1

Schemes:

Summary

Tag: Groups

Operations about group

Operation Description
GET /groups

Get a list of groups

POST /groups

Create a group

GET /groups/{groupId}

Get details for the given group

POST /groups/{groupId}/members

Add members to the given group

Tag: Authentication

Operation about authentication

Operation Description
POST /auth/login

login to generate verification code

POST /auth/verifyCode

Verify code to obtain API key and authentication token

Tag: Stats

Operations about stat

Operation Description
GET /groups/{groupId}/stats

Get all stats for the given group

POST /groups/{groupId}/stats

Create a stat in the given group

GET /groups/{groupId}/stats/{statId}

Get details of a stat in the given group

PUT /groups/{groupId}/stats/{statId}

Update details of a stat in the given group

DELETE /groups/{groupId}/stats/{statId}

Delete a stat in the given group

GET /groups/{groupId}/stats/{statId}/settings

Get settings of a stat in the given group

PUT /groups/{groupId}/stats/{statId}/settings

Update settings of a stat in the given group

GET /stats

Get all stats based on the given group name and stat title

Security

X-Auth-Token

Type: apiKey
Name:

X-Auth-Token

In:

header

Description:

required to be set in HTTP header for protected resources

X-API-KEY

Type: apiKey
Name:

X-API-KEY

In:

header

Description:

required to be set in HTTP header for protected resources

Paths

login to generate verification code

POST /auth/login

Tags: Authentication

application/json

201 Created

returns the client id to be used for verification

400 Bad Request

returns a list of errors if the given phone number is not allowed to log in

Verify code to obtain API key and authentication token

POST /auth/verifyCode

Tags: Authentication

application/json

201 Created

returns API key and authentication token after successful verification

400 Bad Request

returns a list of errors if the verification code is not valid

Get a list of groups

GET /groups

Tags: Groups
name

group name

query string

application/json

200 OK

returns a list of groups the currently logged in user owns.

Create a group

POST /groups

Tags: Groups

application/json

201 Created

returns the details of the created group

Get details for the given group

GET /groups/{groupId}

Tags: Groups
groupId path string

application/json

200 OK

returns details of the given group

400 Bad Request

returns a list of errors if the given group doesn't exist or the user doesn't have access to

Add members to the given group

POST /groups/{groupId}/members

Tags: Groups
groupId path string

application/json

200 OK

returns results of adding members

400 Bad Request

returns a list of errors if the given group doesn't exist or the user doesn't have permission

Get all stats for the given group

GET /groups/{groupId}/stats

Tags: Stats
groupId path string

application/json

200 OK

returns an empty body if the stat is deleted successfully.

400 Bad Request

returns a list of errors if the given group doesn't exist or the user doesn't have access to

Create a stat in the given group

POST /groups/{groupId}/stats

Tags: Stats
groupId path string

application/json

201 Created

returns the stat after it is created successfully.

400 Bad Request

returns a list of errors if the request is not valid

Delete a stat in the given group

DELETE /groups/{groupId}/stats/{statId}

Tags: Stats
groupId path string
statId path string

application/json

204 No Content

returns an empty body if the stat is deleted successfully.

400 Bad Request

returns a list of errors if the given group or stat doesn't exist or the user doesn't have access to.

Get details of a stat in the given group

GET /groups/{groupId}/stats/{statId}

Tags: Stats
groupId path string
statId path string

application/json

200 OK

returns details of the given stat in the given group

400 Bad Request

returns a list of errors if the given group or stat doesn't exist

Update details of a stat in the given group

PUT /groups/{groupId}/stats/{statId}

Tags: Stats
groupId path string
statId path string

application/json

200 OK

returns the updated stat if the given stat is updated successfully.

400 Bad Request

returns a list of errors if the given group or stat doesn't exist or the user doesn't have access to.

Get settings of a stat in the given group

GET /groups/{groupId}/stats/{statId}/settings

Tags: Stats
groupId path string
statId path string

application/json

200 OK

returns the updated stat setting

400 Bad Request

returns a list of errors

Update settings of a stat in the given group

PUT /groups/{groupId}/stats/{statId}/settings

Tags: Stats
groupId path string
statId path string

application/json

200 OK

returns the updated stat setting

400 Bad Request

returns a list of errors

Get all stats based on the given group name and stat title

GET /stats

Tags: Stats
groupName

Group Name

query string
statTitle

Stat Title

query string

application/json

200 OK

returns a list of stats matching the given filters

400 Bad Request

returns an error if group name is not specified

Schema definitions

a collection ofCreate Invitation Response: object

Add Member Result: object

type: string , x ∈ { ADDED , EXISTING , INVITED , INVALID }
count: integer (int32)

Add Members Result List: object

data: object[]

API Error: object

message: string

Approval Stat:

value: string , x ∈ { NONE , DONE , NOT_DONE }

Checklist Item: object

name: string (up to 200 chars)
checked: boolean

Checklist Stat:

items: object[]

Create Invitation Response: object

phoneNumber: string
succeeded: boolean

Dialer Stat:

value: string (up to 12 chars)

Done/Not Done Stat:

value: boolean

Group: object

id: string
name: string (up to 80 chars)
description: string (up to 400 chars)

Group List: object

data: object[]

Horizontal Bar Item: object

value: string (up to 12 chars)
color: string , x ∈ { RED , YELLOW , GREEN , ORANGE , PURPLE , GRAY , BLUE }
name: string (up to 200 chars)

Horizontal Bar Stat:

items: object[]

Login Request: object

phoneNumber: string

Mobile phone number that you used to sign up for StatX

"+16502530000"
                                                        
clientName: string (up to 80 chars)

Any name for this access

"Test StatX API"
                                                        

Login Response: object

clientId: string
phoneNumber: string
clientName: string

Number Stat:

value: string (up to 12 chars)
prefix: string (up to 8 chars)
postfix: string (up to 8 chars)
unit: string (up to 24 chars)

Picklist Item: object

name: string (up to 200 chars)
color: string , x ∈ { UNKNOWN , GREEN , YELLOW , RED , ORANGE , PURPLE , GRAY , BLUE }

Picklist Stat:

label: string (up to 200 chars)
currentIndex: integer (int32) , { x ∈ ℤ | x ≥ 0 }
items: object[]

Range Stat:

minValue: string (up to 12 chars)
maxValue: string (up to 12 chars)

Sign Off Stat:

numOfSpots: integer (int32) , { x ∈ ℤ | 2 ≤ x ≤ 8 }

Stat: object

groupId: string
groupName: string
id: string

auto generated by system

title: string (up to 200 chars)
notes: string (up to 4000 chars)
visualType: string , x ∈ { BINARY , DIALER , LINEAR_SLIDER , TRAFFIC_LIGHT , APPROVAL , NUMBER , STEPS , RANGE , PARTICIPATION , CHECK_LIST , PICK_LIST , UNKNOWN , HORIZONTAL_BARS , DONUT }

required for POST operation, but not allowed to change for PUT operation

dueDateTime: string (date-time)
lastUpdatedDateTime: string (date-time)

required for PUT operation and ignored for POST operation

notesLastUpdatedDateTime: string (date-time)

required for changing notes in PUT operation and ignored for POST operation

Stat List: object

data: object[]

Stat Setting: object

notifyMe: boolean

indicates whether notification is enabled for current logged in user

notificationEnabled: boolean

indicates whether notification is enabled for the stat

triggerType: string , x ∈ { ALWAYS , AT_TRANSITION_POINTS , AT_FINAL_STATE }

the type of change to trigger notification

lastUpdatedDateTime: string (date-time)

required for PUT operation and ignored for POST operation

Steps Stat:

items: string[]
string
currentIndex: integer (int32) , { x ∈ ℤ | x ≥ -1 }
completedLabel: string (up to 200 chars)

Traffic Light Stat:

value: string , x ∈ { NONE , RED , YELLOW , GREEN }

user: object

name: string (up to 200 chars)
phoneNumber: string

Verification Code Request: object

verificationCode: string

You can get it from the StatX app on your phone (Settings->authorize this access)

clientId: string

the id for this access

phoneNumber: string

Verification Code Response: object

apiKey: string

set it to the HTTP header named "X-API-KEY" for any protected resources

authToken: string

set it to the HTTP header named "X-Auth-Token" for any protected resources