NAV
cURL

Introduction

BASE URL

https://api.recursion.space

The Recursion.Space API is built on REST principles. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.

API authentication is handled by a unique key generated for your account.

If you need API support or would like to see how others are implementing the platform you will find our staff and community through our Discord server.

Discord Banner 2

Authentication

AUTHENTICATED REQUEST

# With shell, you can just pass the correct header with each request
curl "https://api.recursion.space/v1/" \
  -H "Authorization: Token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

A sample placeholder API key is included in all the examples here, replace with your key prior to making API requests.

Recursion.Space uses API keys to allow access to the API. You can obtain an API key under the developer tab on your dashboard.

Your API key grants privlaged access to your account and by extention spaces, so be sure to keep it secure! Do not share your API keys in publicly accessible areas such as GitHUB, client-side code, and so forth.

Client Libraries

Client, or language, libraries provide a streamlined method for you to consume the API in the native language of your application. Libraries will be added as they become available, to find community libraries vist the Recursion.Space Discord.

Official Repositories

These are the current libraries officially maintained by Recursion.Space on GitHub.

RecursionSpace-Python

Errors

Handling Errors

# Select a client library to see examples of handling different kinds of errors.

Recursion.Space API uses conventional HTTP response codes to indicate the sucess or failure of an API call. In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided. Codes in the 5xx range indicate an error with Recursion.Space servers (these are rare).

Error Code Meaning
400 Bad Request -- Your request is invalid.
403 Authentication -- You do not have permission to view resource.
405 Bad Method -- Method used (GET, POST, DELETE, PUT) not allowed.
418 I'm a teapot.

SPACE

Space Details

GET /v1/spaces
GET /v1/spaces/{space_id}

curl "https://api.recursion.space/v1/spaces/{xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx}" \
  -H "Authorization: Token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

RESPONSE

[
  {
    "id": "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "name": "The Void",
    "address": "1331 12th Ave",
    "address2": "STE 205",
    "city": "Altoona",
    "state": "PA",
    "zipcode": "16601",
    "country": "United States",
    "email": "demo@recursion.space",
    "timezone": "UTC"
  }
]

Return a list of spaces owned by the API Token holder, or return information on a specific space by filtering with the space id.

Returns

Parameter Type Description
id string The uniqe space identifier.
name string Your name for the space.
address string The physical address of the space.
address2 string Address line for STE, UNIT, BLD, ect.
city string City component of the spaces address.
state string State component of the spaces address.
zipcode string Zipcode component of the spaces address.
country string Country where the space is located.
email string Primary/General email for the space.
timezone string Selected timezone for the space.

Operators Details

GET /v1/operators/{space_id}

curl "https://api.recursion.space/v1/operators/xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx" \
  -H "Authorization: Token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

RESPONSE

[
  {
    "facility": "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "cardNumber": "0123456789",
    "phone_number": ,
    "address": "1331 12th Ave",
    "city": "Altoona",
    "state": "PA",
    "zip_code": "16601",
    "username": "DemoUser",
    "first_name": "Lorem",
    "last_name": "Ipsum",
    "email": "demo@recursion.space",
  },
]

Retrive information for all operators ("admins") for the selected space.

Returns

Parameter Type Description
facility string The facility id for which the operator belongs to.
cardNumber string The RFID number assigned to the operator.
phone_number string Operator provided phone number.
address string Operator provided address.
city string City component of address provided by operator.
state string State component of address provided by operator.
zip_code string Zip Code component of address provided by operator.
username string Username assosiated with the operators account.
first_name string Operators first name.
last_name string Operators last name.
email string Operator provided email.

Member Details

GET /v1/members/{space_id}

curl "https://api.recursion.space/v1/members/xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx" \
  -H "Token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

RESPONSE

[
  {
    "cardNumber": "0123456789",
    "access_group": 123,
    "phone_number": "calico",
    "address": 6,
    "city": 7,
    "state": ,
    "zip_code": ,
    "username": ,
    "first_name": ,
    "last_name": ,
    "email": ,
    "restricted_nodes": []
  },
]

Retrieve information for all members associated with a space.

Returns

Parameter Type Description
cardNumber string The RFID number assigned to your member.
access_group integer The ID for the access group that the member belongs to.
phone_number string Member provided phone number.
address string Member provided address.
city string City component of address provided by member.
state string State component of address provided by member.
zip_code string Zip Code component of address provided by member.
username string Username assosiated with the members account.
first_name string Members first name.
last_name string Members last name.
email string Member provided email.
restricted_nodes array List of IDs the member does not have access to within their access group.

Access Details

GET /v1/permissions/{space_id}

curl "https://api.recursion.space/v1/permissions/xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx" \
  -H "Authorization: Token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

RESPONSE

[
  {
    "id": 2,
    "name": "Max",
    "startTime": "unknown",
    "endTime": 5,
    "monday": 10,
    "tuesday": false,
    "wednesday": false,
    "thursday": false,
    "friday": false,
    "saturday": false,
    "sunday": false,
    "twenty_four_seven": true,
    "default_fallback": false,
    "facility": "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "allowedNodes": [19]
  }
]

Returns the available permissions, or access groups, for the space.

Returns

Parameter Type Description
id integer The ID of the access group.
name string Name descriptor for the access group.
startTime integer The daily start time when access is permitted for this group.
endTime integer The daily end time when access is no longer permitted for this group.
monday boolean True if access is is allowed for a Monday, otherwise false.
tuesday boolean True if access is is allowed for a Tuesday, otherwise false.
wednesday boolean True if access is is allowed for a Wednesday, otherwise false.
thursday boolean True if access is is allowed for a Thursday, otherwise false.
friday boolean True if access is is allowed for a Friay, otherwise false.
saturday boolean True if access is is allowed for a Saturday, otherwise false.
sunday boolean True if access is is allowed for a Sunday, otherwise false.
twenty_four_seven boolean Set true if group is allowed acces 24 hours a day, 7 days a week.
facility string The ID for which the access group belongs to.
allowedNodes integer array List of nodes permitted to be used within this group.

MODULES

Modules refer to the safety and training "courses" that can be created within the system.

Module List

GET /v1/modules/{space_id}

curl "https://api.recursion.space/v1/modules/xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx" \
  -H "Authorization: Token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

RESPONSE

[
    {
        "id": #,
        "name": "Proper Tool Lesson",
        "brand": "DeWaukee",
        "model": "TorqueHammer 3000",
        "general_reading": "<p>Lorem ipsum dolor sit amet....</p>",
        "video": "https://youtube.com",
        "classmaker": "https://classmaker.com",
        "required_training": true,
        "classlink": "https://calendar.com",
        "archive": false

    },
]

Returns the details for all modules created at the selected space.

Returns

Parameter Type Description
id integer Identification number of the module.
name string The user defined name for the module.
brand string Brand name of tool the module is assosiated with.
model string Model name of the tool the module is associated with.
general_reading string HTML formatted reading material.
video string URL for an instructional video for the module.
classmaker string URL for the test/quiz of the module.
required_training boolean Indicates if in-person training is a requirement.
classlink string URL to the registration location for the in-person training.
archive boolean Indicator if the module is active or not.

Module Progress

GET /v1/moduleprogress/{username}
POST /v1/moduleprogress/{username}

curl "https://api.recursion.space/v1/moduleprogress/username" \
 -H "Token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \

curl -X POST "https://api.recursion.space/v1/moduleprogress/username" \
 -H "Token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
 -d "module=##"
 -d "param=value"

GET RESPONSE

[
    {
        "module": #,
        "general_reading_completed": true,
        "video_completed": false,
        "classmaker_initiated": true,
        "classmaker_completed": false,
        "required_training_initiated": false,
        "required_training_completed": false,
        "username": "AwesomeMember"
    },
]

GET: Returns the progress for all modules assosiated with a selected user.
POST: Update one or more progress parameters for a selected module.

Returns

Parameter Type Description
module integer The ID of the modules.
general_reading_completed boolean An indication of the user has clicked open the reading material.
video_completed boolean And indication if the user has viewed the video of the module.
classmaker_initiated boolean An indicator that the user has clicked the assosiated exam link.
classmaker_completed boolean Set by the admin once the user has module exam has been passed sucessfully.
required_training_initiated boolean An indicator that he user has clicked to schedule a training time.
required_training_completed boolean Set by the admin once the required training has been complete.
username string Username assosiated with the operators account.