Skip to content
michael-lefebvre edited this page Apr 7, 2013 · 6 revisions

API - app

<app-slug> is the url friendly name of the application also call slug in the JSON.

WARING: you need Master's instance permission or be app's admin to perform those operations.

Global

CRUD - /api/<app-slug>

will return:

    {
        "id": "507af4848b782",
        "name": "Acme Inc.",
        "slug": "acme",
        "locales": [
            {
                "label": "français / France",
                "key": "fr_FR",
                "default": true
            },
            {
                "label": "english / UK",
                "key": "en_UK"
            }
        ],
        "library": {
            "extwhitelist": [
                "jpg",
                "jpeg",
                "gif",
                "png",
                "flv",
                "mp4",
                "ogg",
                "doc",
                "pdf",
                "zip",
                "xml"
            ],
            "files": {
                "document": 0,
                "image": 7,
                "video": 0
            },
            "presets": {
                "mypreset": {
                    "bgcolor": "#f00",
                    "filetype": "jpg",
                    "quality": 75,
                    "actions": [
                        [
                            "crop_resize",
                            200,
                            200
                        ]
                    ]
                }
            }
        },
        "team": [
            {
                "id": "5079459507a7d",
                "role": "admin"
            },
            {
                "id": "507aed2309ec5",
                "role": "editor"
            },
            {
                "id": "508ce077a5d9e",
                "role": "author"
            },
            {
                "id": "50c386fc4dfd6",
                "role": "guest"
            },
            {
                "id": "50cc6081e1464",
                "role": "author"
            }
        ]
    }

PUT allow you to edit name, extwhitelist and locales fields. Once setup, slug can not be changed.

App's Users

To add a use to the application:

POST  - /api/<app-slug>/user/<user-id>

You must provide a role to the new user.

Available roles

  • admin
  • editor
  • author
  • guest (default)

To edit the user's role use:

PUT  - /api/<app-slug>/user/<user-id>

with a new role value.

To remove a user from the application:

DELETE  - /api/<app-slug>/user/<user-id>

App's Admins

To grant a user as admin of the application:

POST  - /api/<app-slug>/admin/<user-id>

To revoke his admin rights:

DELETE  - /api/<app-slug>/admin/<user-id>

Clone this wiki locally