Skip to content

Commit

Permalink
Translation of api based signing guide.
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorntore committed Mar 3, 2025
1 parent c58d5e6 commit 4cb01cf
Show file tree
Hide file tree
Showing 4 changed files with 124 additions and 4 deletions.
5 changes: 5 additions & 0 deletions content/altinn-studio/guides/development/signing/_index.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,8 @@ The different scenarios below can to some extent be combined with each other, bu
{{% insert "content/altinn-studio/guides/development/signing/sign-and-submit/intro.en.md" %}}

[How to configure](/altinn-studio/guides/development/signing/sign-and-submit)

## API based signing
{{% insert "content/altinn-studio/guides/development/signing/api-signing/intro.en.md" %}}

[How to configure](/altinn-studio/guides/development/signing/api-signing)
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
---
title: API based signing
linktitle: API based signing
description: Follow these steps to implement API based signing in your app.
tags: [signering]
weight: 53
aliases:
- /nb/altinn-studio/guides/signing/api-signing
---

## What do we mean by API based signing?

{{% insert "content/altinn-studio/guides/development/signing/api-signing/intro.en.md" %}}

## Prerequisites

If the service should send a signature receipt to the inbox of the signee, the Altinn message service (Correspondence) must be enabled.

## Configuring signing

You can see how to configure signing in an app using the guides found [here](/altinn-studio/guides/development/signing/).
API based signing has the same requirements for configuration, except the layout-set for the signing step can be simpler.

## The most important API calls

### Perform single signing
If only one person should sign in a signing step, you can use the "process next" endpoint:

`PUT /{org}/{app}/instances/{instanceOwnerPartyId}/{instanceGuid}/process/next`

Body:
```json
{
"action": "sign"
}
```

In this case, the process will automatically navigate to the next step once the signature has been saved.
If more people should sign in sequence after each other, more signature steps can be added in a chain.

### Perform parallel signing

If it should be possible for multiple signees to sign in parallel, the following endpoint can be used instead of "process next":

`POST /{org}/{app}/instances/{instanceOwnerPartyId}/{instanceGuid}/actions`

Body:
```json
{
"action": "sign"
}
```

In this case, the process will still be in the signing step after the signature has been saved, and more signees can sign before the process is continued using a "process next" call.

### Information about signees and signatures

If [runtime delegated signing](/altinn-studio/guides/development/signing/runtime-delegated-signing/) is configured, the following endpoint can be used to get a list of the signees and their signing status.
The endpoint can also be used when runtime delegated signing is not used, but then it will only return signees that have already performed the sign action. It will then function as a signature list.

`GET /{org}/{app}/instances/{instanceOwnerPartyId}/{instanceGuid}/signing`

Example response before any signing has been done, where one person and one organisation is supposed to sign:
```json
{
"signeeStates": [
{
"name": "BØYLEHEST MATT",
"organisation": null,
"delegationSuccessful": true,
"notificationStatus": "Sent",
"partyId": 51281269,
"signedTime": null
},
{
"name": null,
"organisation": "LYDIG VENNLIG KATT KJERNE",
"delegationSuccessful": true,
"notificationStatus": "Sent",
"partyId": 51843877,
"signedTime": null
}
]
}
```

The same response after the signing has been done. Bøylehest Matt signed on behalf of themselves, and Fisk Kunstig signed on belaf of the organisation Lydig Vennlig Katt Kjerne:
```json
{
"signeeStates": [
{
"name": "BØYLEHEST MATT",
"organisation": null,
"delegationSuccessful": true,
"notificationStatus": "Sent",
"partyId": 51281269,
"signedTime": "2025-03-03T11:16:02.9390324Z"
},

{
"name": "FISK KUNSTIG",
"organisation": "LYDIG VENNLIG KATT KJERNE",
"delegationSuccessful": true,
"notificationStatus": "Sent",
"partyId": 51843877,
"signedTime": "2025-03-03T11:18:25.9518554Z"
}
]
}
```
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Dersom kun én person skal signere i et signeringssteg så kan man benytte "proc
`PUT /{org}/{app}/instances/{instanceOwnerPartyId}/{instanceGuid}/process/next`

Body:
```
```json
{
"action": "sign"
}
Expand All @@ -45,7 +45,7 @@ Dersom man ønsker at flere skal kunne signere i parallell, så må man benytte
`POST /{org}/{app}/instances/{instanceOwnerPartyId}/{instanceGuid}/actions`

Body:
```
```json
{
"action": "sign"
}
Expand All @@ -61,7 +61,7 @@ Endepunktet kan også brukes selv om man ikke benytter brukerstyrt signering, me
`GET /{org}/{app}/instances/{instanceOwnerPartyId}/{instanceGuid}/signing`

Eksempel på respons før signering er utført, hvor en person og en virksomhet skal signere:
```
```json
{
"signeeStates": [
{
Expand All @@ -85,7 +85,7 @@ Eksempel på respons før signering er utført, hvor en person og en virksomhet
```

Etter signering, hvor personen Bøylehest Matt har signert på vegne av seg selv, og personen Fisk Kunstig har signert på venge av organisasjonen Lydig Vennlig Katt Kjerne:
```
```json
{
"signeeStates": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
hidden: true
---

It's possible to use the signing functionality using only API calls, without using the Altinn user interface.

0 comments on commit 4cb01cf

Please sign in to comment.