Skip to content

Instantly share code, notes, and snippets.

@reactormonk
Created June 1, 2016 19:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reactormonk/8b7b3d66363e0bb44ea715cc628a9e80 to your computer and use it in GitHub Desktop.
Save reactormonk/8b7b3d66363e0bb44ea715cc628a9e80 to your computer and use it in GitHub Desktop.
FORMAT: 1A
HOST: https://example.com/api/
# API Root [/]
## Retrieve the Entry Point [GET]
+ Response 200 (application/json)
+ Attributes (object)
+ Body
{
"companies": "/companies/1",
"users": "/users/2",
"workflowSelections": "/workflow-selections/3"
}
## Company [/companies]
+ Attributes
+ id: `unique-id` (string, required) - Unique identifier
+ users: `[unique-id]` (array[string], required) - Array of User ID's that belong to it
### Request an Account [GET /companies/{company}]
+ Parameters
+ company (string, required) - Company ID
+ Response 200 (application/json)
+ Attributes
+ company (Company, required)
+ Body
{
"company": {
"id": 1,
"users": [2]
}
}
## User [/users]
+ Attributes
+ id: `unique-id` (string, required) - Unique identifier
+ company: `unique-id` (string, required) - Company ID
+ workflowSelection: `unique-id` (string, required) - Workflow Selection ID
+ email: `foo@bar.com` (string, required) - User email
### Request a User [GET /users/{user}]
+ Parameters
+ user (string, required) - User ID
+ Response 200 (application/json)
+ Attributes
+ user (User, required) - User Account record
+ Body
{
"user": {
"id": 2,
"company": 1,
"workflowSelection": 3,
"email": "foo@bar.com"
}
}
## Workflow Selection [/workflow-selections]
+ Attributes
+ id: `unique-id` (string, required) - Unique identifier
+ user: `unique-id` (string, required) - User ID
+ activeDataVersion: `unique-id` (string, required) - Data Version ID that's selected
+ Default: `""`
### Request a Workflow Selection [GET /workflow-selections/{selection}]
+ Parameters
+ selection (string, required) - Selection ID
+ Response 200 (application/json)
+ Attributes
+ workflowSelection (Workflow Selection, required)
+ Body
{
"workflowSelection": {
"id": 3,
"user": 2,
"activeDataVersion": 6
}
}
### Save a Workflow Selection [PUT /workflow-selections/{selection}]
+ Parameters
+ selection (string, required) - Selection ID
+ Attributes
+ workflowSelection (object, required)
+ activeDataVersion: `unique-id` (string, optional) - Unique ID
+ Request (application/json)
+ Response 203 (application/json)
+ Attributes
+ workflowSelection (Workflow Selection, required)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment