Studio Module For Rest

The studio module for our REST api is designed to let app partners write apps that can benefit the administator in Reviso.

How does it work?

To use the studio module the first step is to issue a grant to an adminstrator agreement. This works just like any other grant, but for an administrator grant.

Administrator grants cannot access most endpoint in the API – they only currently have access to the self endpoint and the studio module.

The self endpoint retrieves information about the agreement for the grant being used. The property IsAdminAgreement will let app partners determine if the grant has been issued for an administrator agreement or not.

The studio module has 2 important end points client-agreements and client-grants. The first can be used to get a list of the agreements the administrator has access to.

GET /studio/client-agreements

Returns:

{
  "collection": [
    {
      "agreementNumber": 1,
      "blocked": false,
      "forDeletion": false,
      "name": "Test 1",
      "self": "https://rest.reviso.com/studio/client-agreements/1"
    },
    {
      "agreementNumber": 2,
      "blocked": true,
      "forDeletion": false,
      "name": "Test 2",
      "self": "https://rest.reviso.com/studio/client-agreements/2"
    },
    {
      "agreementNumber": 3,
      "blocked": false,
      "forDeletion": true,
      "name": "Test 3",
      "self": "https://rest.reviso.com/studio/client-agreements/3"
    }
  ],
  "metaData": {}
}

For this example the administrator has access to 3 agreements – one is blocked and another is marked for deletion.

The second endpoint client-grants makes it possible to generate temporary grants to access the client agreement’s accounting data.

POST /studio/client-grants

[
    {
      "agreementNumber": 1,
      "blocked": false,
      "forDeletion": false,
      "name": "Test 1",
      "self": "https://rest.reviso.com/studio/client-agreements/1"
    }
]

For this example we generate a grant for the first agreement – the other 2 from our example would fail due to their blocked and forDeletion state respectively.

Please note that we posted an array with agreements we want to receive a temporary grants for. This can be used to generate for multiple grants in one call. It is also possible to just send a body with just one element.

The call will return:

[
  {
    "clientAgreement": {
      "agreementNumber": 1,
      "blocked": false,
      "forDeletion": false,
      "name": "Test 1",
      "self": "https://rest.reviso.com/studio/client-agreements/1"
    },
    "grantToken": "SOME-TEMP-GRANT-TOKEN"
  }
]

The temporary grant token can then be used to work with the data for the client agreement. If the grant times out or expires, a new will have to be acquired.

Leave a reply