Signing
Start sign
The POST /v3/freja/sign endpoint is used to sign a text using Freja eID.
POST /v3/freja/sign
Authorization: Basic ${ base64(accountId + ':' + secretKey) }
{
"ssn": "YYYYMMDDXXXX",
"text": "Text to be signed",
"minRegistrationLevel": "EXTENDED",
"orgNumber": "559000-0948",
"callbackUrl": "https://...",
"refId": "12398698"
}
- curl
- C#
- Dart
- Go
- JavaScript
- Java / Kotlin
- PHP
- Python
- Ruby
- Rust
- Swift
curl -u "$ACCOUNT_ID:$SECRET_KEY" https://api.idkollen.se/v3/freja/sign \
-H 'Content-Type: application/json' \
-d '{
"text": "Text to be signed",
"ssn": "YYYYMMDDXXXX",
"callbackUrl": "https://example.com/callback",
"minRegistrationLevel": "EXTENDED",
"orgNumber": "559000-0948",
"refId": "12398698"
}'
var status = await client.Freja.SignAsync(new FrejaSignRequest("Text to be signed")
{
Ssn = "YYYYMMDDXXXX",
CallbackUrl = "https://example.com/callback",
MinRegistrationLevel = "EXTENDED",
OrgNumber = "559000-0948",
RefId = "12398698",
});
final status = await client.freja.sign(const FrejaSignRequest(
text: 'Text to be signed',
ssn: 'YYYYMMDDXXXX',
callbackUrl: 'https://example.com/callback',
minRegistrationLevel: 'EXTENDED',
orgNumber: '559000-0948',
refId: '12398698',
));
// func ptr[T any](v T) *T { return &v }
status, err := client.Freja().Sign(ctx, identisure.FrejaSignRequest{
Text: "Text to be signed",
Ssn: ptr("YYYYMMDDXXXX"),
CallbackUrl: ptr("https://example.com/callback"),
MinRegistrationLevel: ptr("EXTENDED"),
OrgNumber: ptr("559000-0948"),
RefId: ptr("12398698"),
})
const status = await client.freja().sign({
text: "Text to be signed",
ssn: "YYYYMMDDXXXX",
callbackUrl: "https://example.com/callback",
minRegistrationLevel: "EXTENDED",
orgNumber: "559000-0948",
refId: "12398698",
});
import com.identisure.client.models.*;
var status = client.freja().sign(new FrejaSignRequest()
.setText("Text to be signed")
.setSsn("YYYYMMDDXXXX")
.setCallbackUrl("https://example.com/callback")
.setMinRegistrationLevel(FrejaRegistrationLevel.EXTENDED)
.setOrgNumber("559000-0948")
.setRefId("12398698")
).join();
use Identisure\Client\Models\Freja\FrejaSignRequest;
$status = $client->freja()->sign(new FrejaSignRequest(
text: 'Text to be signed',
ssn: 'YYYYMMDDXXXX',
callbackUrl: 'https://example.com/callback',
minRegistrationLevel: 'EXTENDED',
orgNumber: '559000-0948',
refId: '12398698',
));
from identisure_client.models import FrejaSignRequest
status = client.freja().sign(
FrejaSignRequest(
text="Text to be signed",
ssn="YYYYMMDDXXXX",
callback_url="https://example.com/callback",
min_registration_level="EXTENDED",
org_number="559000-0948",
ref_id="12398698",
)
)
status = client.freja.sign(
Identisure::Freja::SignRequest.new(
text: 'Text to be signed',
ssn: 'YYYYMMDDXXXX',
callback_url: 'https://example.com/callback',
min_registration_level: 'EXTENDED',
org_number: '559000-0948',
ref_id: '12398698',
)
)
use identisure_client::models::{FrejaRegistrationLevel, FrejaSignRequest, OrgNumber, Url};
let request = FrejaSignRequest::new("Text to be signed")
.ssn("YYYYMMDDXXXX")
.callback_url(Url::parse("https://example.com/callback")?)
.min_registration_level(FrejaRegistrationLevel::Extended)
.org_number(OrgNumber::parse("559000-0948")?)
.ref_id("12398698");
let status = client.freja().sign(request).await?;
let status = try await client.freja.sign(FrejaSignRequest(
text: "Text to be signed",
ssn: "YYYYMMDDXXXX",
callbackUrl: "https://example.com/callback",
minRegistrationLevel: "EXTENDED",
orgNumber: "559000-0948",
refId: "12398698"
))
| Parameter | Required | Description |
|---|---|---|
| ssn | No | The SSN of the user who should sign. If given, the signing is sent straight to that user's Freja app, and only they can sign. |
| text | Yes | The text to sign, will be displayed in the Freja eID app. |
| minRegistrationLevel | No | Can be one of: 'EXTENDED' or 'PLUS'. The minimum Freja eID registration level that the end user needs to have to be able to sign the request. If excluded, the request will default to EXTENDED. |
| refId | No | Reference ID which will be included in the result and in the callback. |
| callbackUrl | No | Custom callback URL, must be whitelisted. See Callbacks. |
| orgNumber | No | Swedish organization number, such as 559000-0948. Used to perform checks for company signatory. To enable this feature, contact IDkollen. |
IDkollen will respond with HTTP status 201 for successful request, or 4xx/5xx on errors. For more information about errors, please see the Errors section.
{
"id": "1668b9da-bff1-4dfc-ad48-60507b5a8d12",
"refId": "12398698",
"status": "PENDING",
"autoStartToken": "abcdef",
"qrData": "abcdef"
}
| Property | Description |
|---|---|
| id | Authentication id, used to cancel or get the status of this sign request. |
| refId | The refId given in the request, if any. |
| autoStartToken | A token used to launch the Freja app on the same device. |
| qrData | Used to generate a QR code to sign using Freja on another device. |
Backchannel Sign
The POST /v3/freja/backchannel/sign endpoint can be used to start a signing using Freja over the wire.
This method will trigger the user's Freja app to start the signing using an SSN alone, without a QR code.
This is an addon feature. Contact us at support@idkollen.se to enable this feature.
POST /v3/freja/backchannel/sign
Authorization: Basic ${ base64(accountId + ':' + secretKey) }
{
"ssn": "YYYYMMDDXXXX",
"country": "SWEDEN",
"text": "Text to be signed",
"minRegistrationLevel": "EXTENDED",
"requestAddress": false,
"orgNumber": "559000-0948",
"callbackUrl": "https://...",
"refId": "12398698"
}
- curl
- C#
- Dart
- Go
- JavaScript
- Java / Kotlin
- PHP
- Python
- Ruby
- Rust
- Swift
curl -u "$ACCOUNT_ID:$SECRET_KEY" https://api.idkollen.se/v3/freja/backchannel/sign \
-H 'Content-Type: application/json' \
-d '{
"ssn": "YYMMDDXXXX",
"country": "SWEDEN",
"text": "Text to be signed",
"callbackUrl": "https://example.com/callback",
"minRegistrationLevel": "EXTENDED",
"refId": "12398698"
}'
var status = await client.Freja.BackchannelSignAsync(new FrejaBackchannelSignRequest("YYMMDDXXXX", "SWEDEN", "Text to be signed")
{
CallbackUrl = "https://example.com/callback",
MinRegistrationLevel = "EXTENDED",
RefId = "12398698",
});
final status = await client.freja.backchannelSign(const FrejaBackchannelSignRequest(
ssn: 'YYMMDDXXXX',
country: 'SWEDEN',
text: 'Text to be signed',
callbackUrl: 'https://example.com/callback',
minRegistrationLevel: 'EXTENDED',
refId: '12398698',
));
// func ptr[T any](v T) *T { return &v }
status, err := client.Freja().BackchannelSign(ctx, identisure.FrejaBackchannelSignRequest{
Ssn: "YYMMDDXXXX",
Country: "SWEDEN",
Text: "Text to be signed",
CallbackUrl: ptr("https://example.com/callback"),
MinRegistrationLevel: ptr("EXTENDED"),
RefId: ptr("12398698"),
})
const status = await client.freja().backchannelSign({
ssn: "YYMMDDXXXX",
country: "SWEDEN",
text: "Text to be signed",
callbackUrl: "https://example.com/callback",
minRegistrationLevel: "EXTENDED",
refId: "12398698",
});
import com.identisure.client.models.*;
var status = client.freja().backchannelSign(new FrejaBackchannelSignRequest()
.setSsn("YYMMDDXXXX")
.setCountry("SWEDEN")
.setText("Text to be signed")
.setCallbackUrl("https://example.com/callback")
.setMinRegistrationLevel(FrejaRegistrationLevel.EXTENDED)
.setRefId("12398698")
).join();
use Identisure\Client\Models\Freja\FrejaBackchannelSignRequest;
$status = $client->freja()->backchannelSign(new FrejaBackchannelSignRequest(
ssn: 'YYMMDDXXXX',
country: 'SWEDEN',
text: 'Text to be signed',
callbackUrl: 'https://example.com/callback',
minRegistrationLevel: 'EXTENDED',
refId: '12398698',
));
from identisure_client.models import FrejaBackchannelSignRequest
status = client.freja().backchannel_sign(
FrejaBackchannelSignRequest(
ssn="YYMMDDXXXX",
country="SWEDEN",
text="Text to be signed",
callback_url="https://example.com/callback",
min_registration_level="EXTENDED",
ref_id="12398698",
)
)
status = client.freja.backchannel_sign(
Identisure::Freja::BackchannelSignRequest.new(
ssn: 'YYMMDDXXXX',
country: 'SWEDEN',
text: 'Text to be signed',
callback_url: 'https://example.com/callback',
min_registration_level: 'EXTENDED',
ref_id: '12398698',
)
)
use identisure_client::models::{Country, FrejaBackchannelSignRequest, FrejaRegistrationLevel, Url};
let request = FrejaBackchannelSignRequest::new("YYMMDDXXXX", Country::Sweden, "Text to be signed")
.callback_url(Url::parse("https://example.com/callback")?)
.min_registration_level(FrejaRegistrationLevel::Extended)
.ref_id("12398698");
let status = client.freja().backchannel_sign(request).await?;
let status = try await client.freja.backchannelSign(FrejaBackchannelSignRequest(
ssn: "YYMMDDXXXX",
country: "SWEDEN",
text: "Text to be signed",
callbackUrl: "https://example.com/callback",
minRegistrationLevel: "EXTENDED",
refId: "12398698"
))
| Parameter | Required | Description |
|---|---|---|
| ssn | Yes | The SSN of the user who should sign, in the format of its country. See formats. |
| country | Yes | The country associated with the SSN, such as SWEDEN. |
| text | Yes | The text to sign, will be displayed in the Freja eID app. |
| minRegistrationLevel | No | Can be one of: 'EXTENDED' or 'PLUS'. The minimum Freja eID registration level that the end user needs to have to be able to sign the request. If excluded, the request will default to EXTENDED. |
| requestAddress | No | If set, will request the address of the signing user. The functionality needs to be enabled for your company. Contact support to enable requestAddress. |
| refId | No | Reference ID which will be included in the result and in the callback. |
| callbackUrl | No | Custom callback URL, must be whitelisted. See Callbacks. |
| orgNumber | No | Swedish organization number, such as 559000-0948. Used to perform checks for company signatory. To enable this feature, contact IDkollen. |
IDkollen will respond with HTTP status 201 for successful request, or 4xx/5xx on errors. For more information about errors, please see the Errors section.
{
"id": "1668b9da-bff1-4dfc-ad48-60507b5a8d12",
"refId": "12398698",
"status": "PENDING"
}
| Property | Description |
|---|---|
| id | Sign id, used to cancel or get the status of this sign request. |
| refId | The refId given in the request, if any. |
Fetch result
As an alternative to receiving a callback from IDkollen on successful or failed requests, you can use the
GET /v3/freja/sign/{{id}} endpoint to check the status of a sign request.
NOTE: This endpoint is rate limited to one request per second. See Errors.
GET /v3/freja/sign/{{id}}
Authorization: Basic ${ base64(accountId + ':' + secretKey) }
- curl
- C#
- Dart
- Go
- JavaScript
- Java / Kotlin
- PHP
- Python
- Ruby
- Rust
- Swift
curl -u "$ACCOUNT_ID:$SECRET_KEY" https://api.idkollen.se/v3/freja/sign/$ID
var status = await client.Freja.SignStatusAsync(id);
final status = await client.freja.signStatus(id);
status, err := client.Freja().SignStatus(ctx, id)
const status = await client.freja().signStatus(id);
var status = client.freja().signStatus(id).join();
$status = $client->freja()->signStatus($id);
status = client.freja().sign_status(id)
status = client.freja.sign_status(id)
let status = client.freja().sign_status(&id).await?;
let status = try await client.freja.signStatus(id: id)
This endpoint will respond with a HTTP status of 404 if the sign session has expired.
The status of a sign can be either one of: PENDING, COMPLETED or FAILED.
Pending
{
"id": "1668b9da-bff1-4dfc-ad48-60507b5a8d12",
"refId": "12398698",
"status": "PENDING",
"autoStartToken": "abcdef",
"qrData": "abcdef"
}
| Parameter | Description |
|---|---|
| refId | The refId given in the request, if any. |
| autoStartToken | A token used to launch the Freja app on the same device. |
| qrData | Used to generate a QR code to sign using Freja on another device. |
Completed
{
"id": "1668b9da-bff1-4dfc-ad48-60507b5a8d12",
"refId": "12398698",
"status": "COMPLETED",
"ssn": "YYYYMMDDXXXX",
"country": "SWEDEN",
"name": "Firstname Lastname",
"givenName": "Firstname",
"surname": "Lastname",
"address": "Address",
"companySignatoryText": "X är företrädare för Y...",
"signedAt": "2024-01-15T13:37:00Z"
}
| Parameter | Description |
|---|---|
| refId | The refId given in the request, if any. |
| ssn | The personal identification number of the authenticated user. |
| country | The country associated with the SSN |
| name | The full name of the authenticated user. |
| givenName | The given name of the authenticated user. |
| surname | The surname of the authenticated user. |
| address | An address of the authenticated user. May be null if requestAddress was unset, or if no such data is available. |
| companySignatoryText | A text describing whether the authenticated user is a signatory for the given organisation number. |
| signedAt | The time the signing completed (ISO-8601). |
Failed
{
"id": "1668b9da-bff1-4dfc-ad48-60507b5a8d12",
"refId": "12398698",
"status": "FAILED",
"error": "INVALID_ID"
}
| Parameter | Description |
|---|---|
| refId | The refId given in the request, if any. |
| error | An error code describing the reason for why the authentication failed. |
The error may be one of the following values:
| Code | Description |
|---|---|
| AUTH_FAILED | A generic code for any kind of failure. |
| CANCELLED | The authentication was cancelled either by the user or the partner. |
| INVALID_ID | The ID has expired or is otherwise invalid. |
| INTERNAL_ERROR | An internal error occurred causing the authentication to fail. |
| SESSION_TIMEOUT | The authentication expired or timed out. |
| UNSUPPORTED_CLIENT | The client used for the authentication is not supported. |
New error codes may be added in the future without prior notice. The partner should therefore handle unknown error codes in their implementations.
Cancel signing
The DELETE /v3/freja/sign/{{id}} endpoint is used to cancel an ongoing Freja signing.
DELETE /v3/freja/sign/{{id}}
Authorization: Basic ${ base64(accountId + ':' + secretKey) }
- curl
- C#
- Dart
- Go
- JavaScript
- Java / Kotlin
- PHP
- Python
- Ruby
- Rust
- Swift
curl -u "$ACCOUNT_ID:$SECRET_KEY" -X DELETE https://api.idkollen.se/v3/freja/sign/$ID
await client.Freja.CancelSignAsync(id);
await client.freja.cancelSign(id);
err := client.Freja().CancelSign(ctx, id)
await client.freja().cancelSign(id);
client.freja().cancelSign(id).join();
$client->freja()->cancelSign($id);
client.freja().cancel_sign(id)
client.freja.cancel_sign(id)
client.freja().cancel_sign(&id).await?;
try await client.freja.cancelSign(id: id)
IDkollen will respond with HTTP status 204 for successful request, or 4xx/5xx on errors. For more information about errors, please see the Errors section.