Share API

Start sharing

Scope
Add access rights to a specific session.

Description

  1. The session is accompanied by information about the person and the level of his/her access rights;
  2. If a person who is already attached to the session is subordinate, information is corrected according to the supplied data;
  3. The session is set to show that it is shared.

Request
The Service provider's application sends the following GET request using TLS:

POST /api-share/v1.0/{sessionId}/persons
PropertyTypeUsageDescription
sessionIdString (64)MandatoryFile processing session identifier

Authorization
The request must contain an Authorization header with an OAuth Introspect access token obtained via Integration Platform a Service provider's credentials grant flow.

Content-type Header

Content-Type: application/json

Body

{
  "note": {String},
  "persons": [
    {
      "personId": {String},
      "accessRights": {Integer}
    }
  ]
}
PropertyDescription
personIdIdentificator of of the person who shall access this session
accessRightsAccess rights level. For detailed information, please see "Person access list description".
noteAdditional information field.

Example

POST /api-share/v1/80832540faff3f90246b71122a4bd6896cd50933cc12a22d99a577b7b41d55e2/Persons HTTP/1.1
Authorization: Bearer a477b3a3366768c07e4c458f518711b4b351e8d2c2f0f78a1524e4d3efd00603
Host: signapi-prep.eparaksts.lv
{
  "note": "test",
  "persons": [
    {
      "personId": "111111-11111",
      "accessRights": 5
    }
  ]
}

Response
JSON object:

{
  "data": {String}
}
PropertyDescription
dataInformation about sharing status

Example

{
    "data": "Sharing of the session 6aa64f352666d8a965483527d2bc930fc93ccd3be551a4642cd8a6631b97ee89 changed. 1 persons added, rights for 0 persons modified. With note= test"
}

Remove sharing

Scope
Remove access rights from the specific session.

Description

  1. Person access rights to the session is removed
  2. If there is no other Persons with whom session is shared, status "shared" is removed from the session.

Request
The Service provider's application sends the following GET request using TLS:

DELETE /api-share/v1.0/{sessionId}/persons/{personId}
PropertyDescription
sessionIdFile processing session identifier
personIdIdentificator of of the person

Authorization
The request must contain an Authorization header with an OAuth Introspect access token obtained via Integration Platform a Service provider's credentials grant flow.

Example

DELETE /api-share/v1/80832540faff3f90246b71122a4bd6896cd50933cc12a22d99a577b7b41d55e2/Persons/111111-11111 HTTP/1.1
Authorization: Bearer a477b3a3366768c07e4c458f518711b4b351e8d2c2f0f78a1524e4d3efd00603
Host: signapi-prep.eparaksts.lv

Response
JSON object:

PropertyDescription
dataInformation about operation status

Example

{
    "data": "Sharing of the session 552825f4eafdbf90a676ea40c4802c9d1f27c20373c2594c0dfe950976ce2b19 removed for 1 person"
}

Persons in session

Scope
Find out the persons with whom session is shared.

Description
Returns a list of people associated with the session.

Request
The Service provider's application sends the following GET request using TLS:

GET /api-share/v1.0/{sessionId}/persons
PropertyTypeUsageDescription
sessionIdString (64)MandatoryFile processing session identifier

Authorization
The request must contain an Authorization header with an OAuth Introspect access token obtained via Integration Platform a Service provider's credentials grant flow.

Example

GET /api-share/v1/552825f4eafdbf90a676ea40c4802c9d1f27c20373c2594c0dfe950976ce2b19/Persons HTTP/1.1
Authorization: Bearer a477b3a3366768c07e4c458f518711b4b351e8d2c2f0f78a1524e4d3efd00603
Host: signapi-prep.eparaksts.lv

Response
JSON object:

{
  "data": [
    {
      "personId": {String},
      "accessRights": {Integer}
    }
  ]
}
PropertyDescription
personIdIdentificator of of the person who shall access this session
accessRightsAccess rights level. For detailed information, please see "Person access list description".

Example

{
    "data": [
        {
            "personId": "111111-11111",
            "accessRights": 5
        },
        {
            "personId": "222222-22222",
            "accessRights": 1
        }
    ]
}

Sessions of a Person

Scope
Find out the sessions which are shared with the specific person .

Description
Returns a list of the sessions associated to the person.

Request
The Service provider's application sends the following GET request using TLS:

GET /api-share/v1.0/{personId}/sessions
PropertyDescription
personIdIdentificator of the person

Authorization
The request must contain an Authorization header with an OAuth Introspect access token obtained via Integration Platform a Service provider's credentials grant flow.

Example

GET /api-share/v1/111111-111111/Sessions HTTP/1.1
Authorization: Bearer a477b3a3366768c07e4c458f518711b4b351e8d2c2f0f78a1524e4d3efd00603
Host: signapi-prep.eparaksts.lv

Response
JSON object:

{
  "data": [
    {
      "sessionId": {String},
      "fileCount": {Integer},
      "personCount": {Integer},
      "signed": {Integer},
      "shared": {Boolean},
      "archived": {Boolean},
      "signedFileType": {String},
      "lastModified": {String},
      "removalTime":{String}
    }
  ]
}

sessionId

File processing session identifier

fileCount

File amount in the session

personCount

Number of people the session was shared with

signed

Session signing status:
0 - files loaded but not signed
1 - already signed files where loaded
2 - files signed

shared

Sharing statuss:

  • *false** - session is not shared
  • *true** - session is shared

archived

Archive timestamp statuss:

  • *false** - do not contain archive timestap
  • *true** - archive timestap added

signedFileType

If signed, shows format of the signed file

lastModified

Time of last file processing request

removalTime

Expected process deletion time

Example

{
    "data": [
        {
            "sessionId": "552825f4eafdbf90a676ea40c4802c9d1f27c20373c2594c0dfe950976ce2b19",
            "fileCount": 0,
            "personCount": 2,
            "signed": 0,
            "shared": false,
            "archived": false,
            "lastModified": "0001-01-01T00:00:00",
            "removalTime": "0001-01-01T00:00:00"
        },
        {
            "sessionId": "1d72da6fd2d71810f96d04e9261bee6f3b01eaba95ed9b25be0cd6230910902b",
            "fileCount": 0,
            "personCount": 1,
            "signed": 0,
            "shared": false,
            "archived": false,
            "lastModified": "0001-01-01T00:00:00",
            "removalTime": "0001-01-01T00:00:00"
        }
    ]
}

Person access list description

Property

Description

accessRights

Access rights values:
1 - Sign
2 - Delete
4 - Read
8 - Share
16 - Reserved

⚠️ "accessRights" value is a summ of all neded operations. Value is from "0" (no access rights) to "31" (Sign+Delete+Read+Share+Reserved). ⚠️