Projects

Create a new Project

Note: by default, the user creating the project will be automatically assigned to the owner role for this particular project.

POST /projects

Parameters (JSON)

Name Type Description
name string The project's name.

Example

{
    "name": "The Next Big Thing"
}

Response

{
  "meta": {
    "status": 201
  },
  "payload": {
    "id": "100c03f8-d4ef-4a82-86a0-2543edf0fd64",
    "name": "The Next Big Thing",
    "keys": []
  }
}

Get Projects

Returns all projects that the requesting user (as enclosed in access token) has access to.

GET /projects

Response

{
  "meta": {
    "status": 200
  },
  "payload": [
    {
      "id": "100c03f8-d4ef-4a82-86a0-2543edf0fd64",
      "name": "The Next Big Thing",
      "keys": []
    },
    {
      "id": "8fae6705-e50d-4211-a445-e245d1a3f30a",
      "name": "My New Mobile Game",
      "keys": []
    }
  ]
}

Get a specific Project

GET /projects/:projectId

Response

{
  "meta": {
    "status": 200
  },
  "payload": {
    "id": "8fae6705-e50d-4211-a445-e245d1a3f30a",
    "name": "My New Mobile Game",
    "keys": []
  }
}

Add a Project Key

POST /projects/:projectId/keys

Parameters (JSON)

Name Type Description
key string The key identifier.

Example

{
  "key": "menu.start.button"
}

Response

{
  "meta": {
    "status": 200
  },
  "payload": {
    "id": "8fae6705-e50d-4211-a445-e245d1a3f30a",
    "name": "My New Mobile Game",
    "keys": [
      "menu.start.button"
    ]
  }
}

Rename Project Keys

Note: this action will also update all project locales to keep things in sync.

PATCH /projects/:projectId/keys

Parameters (JSON)

Name Type Description
oldKey string The key to be renamed.
newKey string The new name for the key.

Example

{
    "oldKey": "menu.start.button",
    "newKey": "menu.welcome.label"
}

Response

{
  "meta": {
    "status": 200
  },
  "payload": {
    "localesAffected": 0,
    "project": {
      "id": "8fae6705-e50d-4211-a445-e245d1a3f30a",
      "name": "My New Mobile Game",
      "keys": [
        "menu.welcome.label"
      ]
    }
  }
}

Delete Project Key

Note: this action will also update all project locales to keep things in sync.

DELETE /projects/:projectId/keys/:key

Parameters (URL parameters)

Name Type Description
key string The key to be deleted.

Example

DELETE /projects/8fae6705-e50d-4211-a445-e245d1a3f30a/keys/menu.welcome.label

Response

{
  "meta": {
    "status": 200
  },
  "payload": {
    "id": "8fae6705-e50d-4211-a445-e245d1a3f30a",
    "name": "My New Mobile Game",
    "keys": []
  }
}

Get users with access to a Project

Note: this won't return the user making the request in the user's list.

GET /projects/:projectId/users

Response

{
  "meta": {
    "status": 200
  },
  "payload": []
}

Grant access to a user

POST /projects/:projectId/users

Parameters (JSON)

Name Type Description
user_id string The ID of the target user to be added.
project_id string The ID of the project to which the user will be added.
role string The role identifier for the user to be added.

Example

{
    "user_id": "55f06ff7-66c9-4568-9a94-d96414fa5e08",
    "project_id": "8fae6705-e50d-4211-a445-e245d1a3f30a",
    "role": "editor"
}

Response

{
  "meta": {
    "status": 200
  },
  "payload": {
    "name": "Susan",
    "email": "[email protected]",
    "project_id": "8fae6705-e50d-4211-a445-e245d1a3f30a",
    "user_id": "55f06ff7-66c9-4568-9a94-d96414fa5e08",
    "role": "editor"
  }
}

Updating a user's role

PATCH /projects/:projectId/users/:userId/role

Parameters (JSON)

Name Type Description
role string The new role identifier for the user.

Example

{
    "role": "viewer"
}

Response

{
  "meta": {
    "status": 200
  },
  "payload": {
    "name": "Susan",
    "email": "[email protected]",
    "project_id": "8fae6705-e50d-4211-a445-e245d1a3f30a",
    "user_id": "55f06ff7-66c9-4568-9a94-d96414fa5e08",
    "role": "viewer"
  }
}

Revoking user access

DELETE /projects/:projectId/users/:userId

Response

Note: delete actions do not return body content. They are acknowledged by a HTTP Status Code of 204

// HTTP Status 204 No Content

results matching ""

    No results matching ""