App

The App is the only one that can manage the Push API.

Without the Auth credentials it is not possible to use any Push API call, all of them are restricted and should be called by an agent that knows how to generate the Auth token.

🚧

Not implemented yet

There will be various security levels in order to manage diferent App types or platforms using the Push API.

Routes

/app

πŸ“˜

Creates a new app that can use the API.

Once the App is created, the return structure contains the secret that should be used to generate the Auth token.

ParamTypeRequired?Description
namestringtrueName of the app that will use the API.

Response

{
    "result": {
        "name": "sample1",
        "secret": "5417b18d88103f6e",
        "id": 1
    }
}

Back to Index

/app/:id

πŸ“˜

Gets the app information given the id.

No params expected.

Response

{
    "result": {
        "id": 1,
        "name": "tviso",
        "secret": "ed999e865f35e478"
    }
}

Back to Index

/app/:id

πŸ“˜

Updates the app :id information with the given one.

ParamsTypeRequired?Description
namestringtrueNew app name to update.

Response

πŸ‘

Updating name sample1 to test1.

{
    "result": {
        "id": 2,
        "name": "test1",
        "secret": "5417b18d88103f6e"
    }
}

Back to Index

/app/:id

πŸ“˜

Deletes the app given its :id.

Response

❗️

Remember that if you delete the App you won't be able to use any Push API call.

{
    "result": true
}

Back to Index

/apps

πŸ“˜

Retrives all the Apps stored of the database.

No params expected.

Response

{
    "result": [
        {
            "id": 1,
            "name": "sample1",
            "secret": "ed299e465a378k7x"
        },
        {
            "id": 2,
            "name": "sample2",
            "secret": "5417b18d88103f6e"
        }
    ]
}

Back to Index