CPPA API

A REST API for managing CollaborationProtocolProfiles and CollaborationProtocolAgreements. A CollaborationProtocolProfile (hereafter referred to as CPP) for a communication party defines which message types it supports. A CollaborationProtocolAgreement (hereafter referred to as CPA) between two communication parties defines which message types they can use to communicate with each other.

Auth

Access to the API is restricted, and requires authentication with HelseId. See the Auth page for more information about how to get started.

Environments

Environment URL
Test cppa.test.grunndata.nhn.no
QA cppa.qa.grunndata.nhn.no
Production cppa.grunndata.nhn.no

Endpoints

HTTP Method Endpoint Description
GET /Profiles/herId Get the Profile for the given herId
GET /Profiles/herId/History Get the audit log for the given herId
GET /Profiles/herId/Processes Get the list of Processes in the Profile of the given herId
POST /Profiles/herId/Processes Add a new Process to the Profile for the given herId
PATCH /Profiles/herId/Processes/uuid/version/role Update the version of a Process used in the Profile for the given herId
PUT /Profiles/herId/Processes/ Set the Processes used in the Profile for the given herId
DELETE /Profiles/herId/Processes/uuid/version/role Delete a Process from the Profile for the given herId
GET /Agreements/cpaId Get a Agreement by its cpaId
GET /Agreements/HerIds/herIdA/herIdB Get the Agreement between the given herIds
DELETE /Agreements/cpaId Delete the Agreement with the given cpaId
GET /AgreementSummaries/herId Get an AgreementSummary for the given herId
GET /Processes Get a list of all available Processes

GET /Profiles/herId

Get the Profile (CPP) for the communication party with the given herId.

Path parameters

Parameter Type Description
herId int The herId of the communication party that the Profile belongs to

Example

Get the Profile (CPP) for communication party with herId 123:

GET /Profiles/123

Curl

curl -X 'GET' \
  'https://cppa.grunndata.nhn.no/Profiles/123' \
  -H 'accept: application/json'

GET /Profiles/herId/History

Get the audit log for the communication party with the given herId.

Path parameters

Parameter Type Description
herId int The herId of the communication party that the Profile belongs to

Example

Get the audit log for the Profile (CPP) for communication party with herId 123:

GET /Profiles/123/History

Curl

curl -X 'GET' \
  'https://cppa.grunndata.nhn.no/Profiles/123/History' \
  -H 'accept: application/json'

GET /Profiles/herId/Processes

Get the list of Processes in the Profile of the given herId. Returns a list of ProcessDefinitions. The list can be used as is for input to PUT for the same endpoint.

Path parameters

Parameter Type Description
herId int The herId of the communication party that the Profile belongs to

Example

Get the Processes in the Profile (CPP) for communication party with herId 123:

GET /Profiles/123/Processes

Curl

curl -X 'GET' \
  'https://cppa.grunndata.nhn.no/Profiles/123/Processes' \
  -H 'accept: application/json'

POST /Profiles/herId/Processes

Add a new Process to the Profile (CPP) for the communication party with the given herId.

Path parameters

Parameter Type Description
herId int The herId of the communication party that the Profile belongs to

Body

Parameters

Parameter Type Description
uuid string The unique identifier (Guid) of the Process to add. Can be found in the template
version string The version of the Process to add. The same uuid may have several versions
role string The name of the role for the Process to add

Body structure

{
  "uuid": "string",
  "version": "string",
  "role": "string"
}

Example

Add a new Process to the Profile (CPP) for herId 123:

POST /Profiles/123/Processes
{
  "uuid": "da9f7883-599c-4b07-b95d-7dcce4f19b93",
  "version": "2.0",
  "role": "Innbygger"
}

Curl

curl -X 'POST' \
  'https://cppa.grunndata.nhn.no/Profiles/123/Processes' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "uuid": "da9f7883-599c-4b07-b95d-7dcce4f19b93",
  "version": "2.0",
  "role": "Innbygger"
}'

PATCH /Profiles/herId/Processes/uuid/version/role

Update the version of a Process used in the Profile (CPP) for the communication party with the given herId.

Path parameters

Parameter Type Description
herId int The herId of the communication party that the Profile belongs to
uuid string The unique identifier (Guid) of the Process to update. Can be found in the template
version string The version of the Process to update (the old version)
role string The name of the role for the Process to update

Body

Parameters

Parameter Type Description
version string The version of the Process to update to (the new version)

Body structure

{
  "version": "string"
}

Example

Update Process to version 2.0 on the Profile for herId 123:

PATCH /Profiles/123/Processes/da9f7883-599c-4b07-b95d-7dcce4f19b93/1.0/Innbygger
{
  "version": "2.0"
}

Curl

curl -X 'PATCH' \
  'https://cppa.test.grunndata.nhn.no/Profiles/123/Processes/da9f7883-599c-4b07-b95d-7dcce4f19b93/1.0/Innbygger' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "version": "2.0"
}'

PUT /Profiles/herId/Processes/

Set the Processes used in the Profile (CPP) for the communication party with the given herId. NB: This will override any Processes that are on the Profile.

Path parameters

Parameter Type Description
herId int The herId of the communication party that the Profile belongs to

Body

The body takes in a list of ProcessDefinitions.

Parameters

Parameter Type Description
uuid string The unique identifier (Guid) of the Process to add. Can be found in the template
version string The version of the Process to add. The same uuid may have several versions
role string The name of the role for the Process to add

Body structure

[
  {
    "uuid": "string",
    "version": "string",
    "role": "string"
  }
]

Example

Set these 2 Processes on the Profile (CPP) for herId 123:

PUT /Profiles/123/Processes
[
  {
    "uuid": "da9f7883-599c-4b07-b95d-7dcce4f19b93",
    "version": "2.0",
    "role": "Innbygger"
  },
  {
    "uuid": "03088aaa-a5dc-4a1b-9895-3139354c27e4",
    "version": "1.1",
    "role": "Innbygger"
  }
]

Curl

curl -X 'PUT' \
  'https://cppa.test.grunndata.nhn.no/Profiles/123/Processes' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '[
  {
    "uuid": "da9f7883-599c-4b07-b95d-7dcce4f19b93",
    "version": "1.0",
    "role": "Innbygger"
  }
]'

DELETE /Profiles/herId/Processes/uuid/version/role

Delete a Process from the Profile (CPP) for the communication party with the given herId.

Path parameters

Parameter Type Description
herId int The herId of the communication party that the Profile belongs to
uuid string The unique identifier (Guid) of the Process to delete. Can be found in the template
version string The version of the Process to delete (the old version)
role string The name of the role for the Process to delete

Example

Delete a Process from the Profile for herId 123:

DELETE /Profiles/123/Processes/da9f7883-599c-4b07-b95d-7dcce4f19b93/1.0/Innbygger

Curl

curl -X 'DELETE' \
  'https://cppa.test.grunndata.nhn.no/Profiles/92104/Processes/da9f7883-599c-4b07-b95d-7dcce4f19b93/1.0/Innbygger' \
  -H 'accept: application/json'

GET /Agreements/cpaId

Get an Agreement (CPA) by its unique identifier.

Path parameters

Parameter Type Description
cpaId string The unique identifier (Guid) of the Agreement

Example

Get the Agreement (CPA) with cpaId af3877ea-a0d8-40a3-9ae9-ab7119060ae3:

GET /Agreements/HerIds/af3877ea-a0d8-40a3-9ae9-ab7119060ae3

Curl

curl -X 'GET' \
  'https://cppa.grunndata.nhn.no/Agreements/af3877ea-a0d8-40a3-9ae9-ab7119060ae3' \
  -H 'accept: application/xml'

GET /Agreements/HerIds/herIdA/herIdB

Get the Agreement (CPA) between the two communication parties with the given herIds.

Path parameters

Parameter Type Description
herIdA int The herId of the first communication party in the Agreement
herIdB int The herId of the second communication party in the Agreement

Example

Get the Agreement (CPA) between the communication parties with herIds 123 and 321:

GET /Agreements/HerIds/123/321

Curl

curl -X 'GET' \
  'https://cppa.grunndata.nhn.no/Agreements/HerIds/123/321' \
  -H 'accept: application/json'

DELETE /Agreements/cpaId

Delete the Agreement with the given cpaId.

Path parameters

Parameter Type Description
cpaId string The unique identifier (Guid) of the Agreement

Example

Delete an Agreement (CPA) with cpaId da9f7883-599c-4b07-b95d-7dcce4f19b93:

DELETE /Agreements/da9f7883-599c-4b07-b95d-7dcce4f19b93

Curl

curl -X 'DELETE' \
  'https://cppa.grunndata.nhn.no/Agreements/da9f7883-599c-4b07-b95d-7dcce4f19b93' \
  -H 'accept: application/json'

GET /AgreementSummaries/herId

Get an AgreementSummary of all Agreements (CPAs) for the communication party with the given herId.

Path parameters

Parameter Type Description
herId int The herId of the communication party

Query parameters

Parameter Type Description
includeExpired boolean Will include expired Agreements if true
includeTerminated boolean Will include terminated Agreements if true

Example

Get the AgreementSummary for communication party with herId 123 and include expired Agreements:

GET /AgreementSummaries/123?includeExpired=true

Curl

curl -X 'GET' \
  'https://cppa.grunndata.nhn.no/AgreementSummaries/123?includeExpired=true' \
  -H 'accept: application/json'

Response

{
  "agreements": [
    {
      "cpaId": "string",
      "terminated": "2023-04-11T12:17:42.195Z",
      "created": "2023-04-11T12:17:42.195Z",
      "start": "2023-04-11T12:17:42.195Z",
      "end": "2023-04-11T12:17:42.195Z",
      "communicationPartySummaryA": {
        "herId": 0,
        "name": "string",
        "parentHerId": 0,
        "parentName": "string",
        "type": "string"
      },
      "communicationPartySummaryB": {
        "herId": 0,
        "name": "string",
        "parentHerId": 0,
        "parentName": "string",
        "type": "string"
      }
    }
  ]
}

GET /Processes

Get a list of all available Processes.

Example

Get all available Processes:

GET /Processes

Curl

curl -X 'GET' \
  'https://cppa.grunndata.nhn.no/Processes' \
  -H 'accept: application/json'

Response

[
  {
    "name": "string",
    "description": "string",
    "categories": [],
    "uuid": "string",
    "version": "string",
    "role": "string"
  },
  {
    "name": "string",
    "description": "string",
    "categories": [
      "string",
      "string"
    ],
    "uuid": "string",
    "version": "string",
    "role": "string"
  }
]