App Installations

The installations endpoint allows you to integrate your applications state object to the vivenu application and update the integration user on the current status of the application.

Base URL: https://apps.vivenu.com/api

You can retrieve the id of an installation via the metadata API

Caution: In order to access this API you have to include the application's clientSecret inside the authorization header of your request.

PATCH/api/installations/:id

Patch App installation

Patch App installation

Updating the status

The user needs information about whether the integration set up is working as expected. With this endpoint you can set your application to LIVE, INTERRUPTED or FAILED, which helps the user to determine if they have set everything up correctly.

Example payload to update operation status

{
    "status": {
        "operation": "LIVE"
    }
}

Utilizing the state

The state can be used to integrate your application with the vivenu backend. For each API key that gets created for you, a state object is available to store additional information about that installation. For example, you could store an application_id needed for execution in the state object and check it when you need to run the application.

Example payload to utilize state

{
    "state": {
        "application_id": "ff926843-9e33-4b7a-9548-517695c34cec"
    }
}

Payload

Optional attributes

  • Name
    status
    Type
    object
    Description
    Optional nested attributes (2)
    • Name
      installation
      Type
      enum(INITIALIZED, CONFIGURED)
      Description

      The target status of the app installation

    • Name
      operation
      Type
      enum(LIVE, INTERRUPTED, FAILED, PENDING)
      Description

      The target operational status of the app

  • Name
    state
    Type
    object
    Description

    An object containing any state information about this installation

Request

PATCH
/api/installations/:id
const response = await fetch('https://apps.vivenu.com/api/installations/507f191e810c19729de860ea', {
  method: 'PATCH',
  headers: {
    Authorization: 'Bearer {token}',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify(  {
    "status": {
      "installation": "INITIALIZED",
      "operation": "LIVE"
    },
    "state": {}
  }),
})

const data = await response.json()

Response (200)

{
  "appId": "507f191e810c19729de860ea",
  "sellerId": "507f191e810c19729de860ea",
  "createdAt": "2030-01-23T23:00:00.123Z",
  "updatedAt": "2030-01-23T23:00:00.123Z",
  "_id": "507f191e810c19729de860ea",
  "status": {
    "installation": "INITIALIZED",
    "operation": "LIVE"
  },
  "apiKey": "string",
  "state": {}
}

GET/api/installations/:id

Get App installation

Get App installation

Returns an app installation for a given installationId if existent. This endpoint is typically invoked when you want to get the state or status of an app installation.

Request

GET
/api/installations/:id
const response = await fetch('https://apps.vivenu.com/api/installations/507f191e810c19729de860ea', {
  method: 'GET',
  headers: {
    Authorization: 'Bearer {token}',
  },
})

const data = await response.json()

Response (200)

{
  "appId": "507f191e810c19729de860ea",
  "sellerId": "507f191e810c19729de860ea",
  "createdAt": "2030-01-23T23:00:00.123Z",
  "updatedAt": "2030-01-23T23:00:00.123Z",
  "_id": "507f191e810c19729de860ea",
  "status": {
    "installation": "INITIALIZED",
    "operation": "LIVE"
  },
  "apiKey": "string",
  "state": {}
}

GET/api/installations

Get all app installations

Get all app installations

Query parameters

Required query parameters

  • Name
    client_id
    Type
    string
    Description

Optional query parameters

  • Name
    top
    Type
    number
    Description
  • Name
    skip
    Type
    number
    Description
  • Name
    installationStatus
    Type
    enum(INITIALIZED, CONFIGURED)
    Description
  • Name
    operationStatus
    Type
    enum(LIVE, INTERRUPTED, FAILED, PENDING)
    Description

Request

GET
/api/installations
const response = await fetch('https://apps.vivenu.com/api/installations?client_id=507f191e810c19729de860ea&top=10.5&skip=10.5&installationStatus=INITIALIZED&operationStatus=LIVE', {
  method: 'GET',
  headers: {
    Authorization: 'Bearer {token}',
  },
})

const data = await response.json()

Response (200)

{
  "appId": "507f191e810c19729de860ea",
  "sellerId": "507f191e810c19729de860ea",
  "createdAt": "2030-01-23T23:00:00.123Z",
  "updatedAt": "2030-01-23T23:00:00.123Z",
  "_id": "507f191e810c19729de860ea",
  "status": {
    "installation": "INITIALIZED",
    "operation": "LIVE"
  },
  "apiKey": "string",
  "state": {}
}

Was this page helpful?