POST /processes/:processId/join

Description

Join a process.

You must specify the role and lanes which the player wishes to join in.

There are 5 possible role values:

  • observer (Can only view the process state)
  • player (Can play the process)
  • admin (Can play and invite players/observers to the process)
  • super_admin (Can play and invite more players with roles super_admin/admin/player/observer to the process)

The lanes available to join depend on the process definition.

If the process is public then the updated process state after the player joins is returned If the process is protected then a generated approval request to join the process is returned If the process is private an error is returned.

For more information about how process joining works check out Process Basics

Resource URL

https://api.playlyfe.com/processes/:processId/join

Method

POST

Scopes

player, game, debug

Parameters

LocationParameter NameDefault ValueDescription
QueryprocessIdThe process ID
Request BodyroleplayerThe role which the player wishes to join as. It can have values observer, player, admin, super_admin and owner.
Request Bodylanes[]The lanes which the player wishes to join in. The allowed values are the lane names present in the process.

Examples

Joining a public process
Request
POST https://api.playlyfe.com/processes/droid/kill/join
{
  "role": "player"
}
Response
{
  "id": "droid/kill",
  "name": "Kill all humans",
  "definition": "work",
  "created": "2013-11-10T16:40:10.570Z",
  "state": "ACTIVE",
  "version": 1,
  "access": "PUBLIC",
  "performers": {
    "droid": [
      "owner"
    ],
    "clone": [
      "player"
    ]
  },
  "collaborators": {},
  "keys": {
    "droid/kill": "work"
  },
  "containers": {
    "work": {
      "key": "droid/kill",
      "tokens": 1,
      "nodes": {
        "beep": {
          "state": "READY",
          "tokens": 1
        }
      }
    }
  }
}
Joining a protected process
Request
POST https://api.playlyfe.com/processes/droid/kill/join
{
  "role": "player",
  "lanes": ["rulers"]
}
Response
{
  "process": {
    "id": "droid/kill",
    "name": "Kill all humans"
  },
  "player": {
    "id": "ripley",
    "alias": "The Amazing Mr.Ripley"
  },
  "state": "PENDING",
  "role": "player",
  "lanes": [ "rulers" ],
  "id": "523215efacc4b2f216000034"
}
Joining a private process
Request
POST https://api.playlyfe.com/processes/john/thievery/join
{
  "role": "player",
  "lanes": ["rulers"]
}
Response
Status: 401
{
  "error": "access_denied",
  "error_description": "You cannot join the private process 'clone/thievery'"
}