Organisation ID Service
- 1 Organisation ID Service Overview
- 2 Initiate Add Organisation ID Method
- 2.1 JSON Example for initAddOrganisationIdRequest
- 2.1.1 organisationId
- 2.2 Examples with Various userInfoTypes
- 2.2.1 EMAIL userInfoType Example Request
- 2.2.2 PHONE userInfoType Example Request
- 2.2.3 SSN userInfoType Example Request
- 2.2.4 UPI userInfoType Example Request
- 2.2.5 INFERRED userInfoType Example Request
- 2.2.6 Example with identifierDisplayTypes and additionalAttributes
- 2.2.7 Possible Errors
- 2.2.8 JSON Response Value
- 2.1 JSON Example for initAddOrganisationIdRequest
- 3 Get One Organisation ID Result Method
- 4 Cancel Add Organisation ID Method
- 5 Update Organisation ID Method
- 6 Delete Organisation ID Method
- 7 Get All Organisation ID Users Method
- 8 Get All Organisation ID Users V1.1 Method
Organisation ID Service Overview
The Organisation ID service allows Relying Parties to set a specific, organisation-related identifier to any user. The end user will have previously downloaded the Freja mobile application on one or more iOS or Android devices they possess, and registered an account in Freja, allowing Relying Parties to refer to them through the use of one or more usernames.
The Organisation ID service is available to end users who have registered with an ID document in Freja at least.
Don’t Forget
There are several technical requirements that must be in place before implementation can begin. Please refer to the section 'Before You Begin' on this page.
Disclaimer
We retain the right to extend the API with new optional parameters, new response fields and error codes. Within the same API version, these additions shall be made strictly without altering existing response fields and error codes so as not to compromise your system's stability. Your application therefore MUST be able to handle unknown response fields and error codes. In the case of unknown response fields, the application SHOULD ignore them and process only those it understands. In the case of unknown error codes, the application MUST present a generic error message to the end-user.
Initiate Add Organisation ID Method
This method is used by a Relying Party to initiate a transaction for provisioning Organisation ID i.e. setting Organisation ID title, identifier name and identifier for a user. The identifier must be unique within the Relying Party's system. If the Organisation ID is set for a user multiple times, the title, identifier name and the identifier will be overridden and the last ones will be active.
The method is called using HTTP POST through the URLs below:
Environment | Endpoint |
|---|---|
TEST |
|
PRODUCTION |
|
JSON Example for initAddOrganisationIdRequest
The parameter of the method is a Base64 UTF8-encoded JSON payload according to the following:
{
"userInfoType":"User info type",
"userInfo":"User information corresponding to user info type",
"minRegistrationLevel":"Minimum required registration level of a user",
"expiry":"Expiry time for the request",
"organisationId":{
"title":"Title of the Organisation ID to be displayed to the end user",
"identifierName":"Name of specific organisation identifier",
"identifier":"Value of specific organisation identifier",
"identifierDisplayTypes": ["QR_CODE","TEXT"],
"additionalAttributes": [{"key":"attribute_key",
"displayText":"attribute_display_name",
"value":"attribute_value"}
]
}
} |
|
| |
For userInfoType set to PHONE, the value must be in the following format: "+4673*******"; the leading '+' sign is present, but the leading '0' for the mobile phone operator code is not. | |
{
"country":"Country of SSN",
"ssn":"Social security number of the end user"
}Where:
| |
| |
| |
|
organisationId
{
"organisationId":{
"title":"Title of the Organisation ID to be displayed to the end user",
"identifierName":"Name of specific organisation identifier",
"identifier":"Value of specific organisation identifier",
"identifierDisplayTypes": ["QR_CODE","TEXT"],
"additionalAttributes": [{"key":"attribute_key",
"displayText":"attribute_display_name",
"value":"attribute_value"}
]
}
} |
|
identifierName: string, mandatory, 30 characters maximum. The name of the specific organisation identifier to be set for the end user. | |
identifier: string, mandatory, 128 characters maximum. The value of the specific organisation identifier to be set for the end user. Must be unique within the requesting relying party system inside the Freja eID service. | |
identifierDisplayTypes: list of identifier types, optional. Can be QR_CODE or TEXT, both or neither. If | |
additionalAttributes: list of Organisation ID attributes, optional. The maximum number of additional attributes is 10. One attribute contains the key (maximum 64 characters), displayText as friendly name (maximum 64 characters) and value (maximum 256 characters), displayTypes which are not supported yet. |
Regarding OrgID Customisation
For more personalisation and flexibility regarding OrgID design, we can offer our OrgID Templates which allow for full customisability of the OrgID. For more information please get in touch with partnersupport@frejaeid.com.
Examples with Various userInfoTypes
EMAIL userInfoType Example Request
If you wish to initiate an 'Add Organisation ID' request for a user with an email address joe.black@freja.com, follow these steps:
Create the JSON structure {"userInfoType":"EMAIL","userInfo":"joe.black@freja.com","minRegistrationLevel":"EXTENDED","expiry":1517526000000,"organisationId": { "title":"Frejviks kommun ID", "identifierName":"Domain name", "identifier":"vejodoe" }}
Encode the JSON structure to Base64.
Create the HTTP POST request with a POST parameter name initAddOrganisationIdRequest and the Base64 encoded JSON structure from the step 2 as its value.
The HTTP body should be the following (compact format, line broken for clarity only):
initAddOrganisationIdRequest=eyJ1c2VySW5mb1R5cGUiOiJFTUFJTCIsInVzZXJJbmZvIjoi
am9lLmJsYWNrQHZlcmlzZWMuY29tIiwibWluUmVnaXN0cmF0aW9uTGV2ZWwiOiJFWFRFTkRFRCIsI
mV4cGlyeSI6MTUxNzUyNjAwMDAwMCwib3JnYW5pc2F0aW9uSWQiOiB7ICJ0aXRsZSI6IlZlcmlzZW
MgSUQiLCAiaWRlbnRpZmllck5hbWUiOiJEb21haW4gbmFtZSIsICJpZGVudGlmaWVyIjoidmVqb2R
vZSIgfX0=PHONE userInfoType Example Request
If you wish to initiate an 'Add Organisation ID' request for a user with a phone number '+46731234567':
Create the JSON structure {"userInfoType":"PHONE","userInfo":"+46731234567","minRegistrationLevel":"EXTENDED","expiry":1517526000000,
"organisationId": { "title":"Frejviks kommun ID", "identifierName":"Domain name", "identifier":"vejodoe" }}Encode the JSON structure to Base64.
Create the HTTP POST request with a POST parameter name initAddOrganisationIdRequest and the Base64 encoded JSON structure from the step 2 as its value.
The HTTP body should be the following (compact format, line broken for clarity only):
initAddOrganisationIdRequest=eyJ1c2VySW5mb1R5cGUiOiJQSE9ORSIsInVzZXJJbmZvIjoiK
zQ2NzMxMjM0NTY3IiwibWluUmVnaXN0cmF0aW9uTGV2ZWwiOiJFWFRFTkRFRCIsImV4cGlyeSI6MTU
xNzUyNjAwMDAwMCwib3JnYW5pc2F0aW9uSWQiOiB7ICJ0aXRsZSI6IlZlcmlzZWMgSUQiLCAiaWRlb
nRpZmllck5hbWUiOiJEb21haW4gbmFtZSIsICJpZGVudGlmaWVyIjoidmVqb2RvZSIgfX0=SSN userInfoType Example Request
If you wish to initiate an 'Add Organisation ID' request for a user with an SSN '198905218072' and country 'SE':
Create the JSON structure {"country":"SE","ssn":"198905218072"}, then do the base64 of this JSON.
This is the Base64 of step 1: 'eyJjb3VudHJ5IjoiU0UiLCJzc24iOiIxOTg5MDUyMTgwNzIifQ==' , which is the userInfo value in our request.
Create the JSON structure {"userInfoType":"SSN","userInfo":"eyJjb3VudHJ5IjoiU0UiLCJzc24iOiIxOTg5MDUyMTgwNzIifQ==",
"minRegistrationLevel":"EXTENDED","expiry":1517526000000,"organisationId":{ "title":"Frejviks kommun ID", "identifierName":"Domain name", "identifier":"vejodoe"}}Encode the JSON structure to Base64.
Create the HTTP POST request with a POST parameter name initAddOrganisationIdRequest and the Base64 encoded JSON structure from the step 4 as its value.
The HTTP body should be the following (compact format, line broken for clarity only):
initAddOrganisationIdRequest=eyJ1c2VySW5mb1R5cGUiOiJTU04iLCJ1c2VySW5mbyI6ImV5S
mpiM1Z1ZEhKNUlqb2lVMFVpTENKemMyNGlPaUl4T1RnNU1EVXlNVGd3TnpJaWZRPT0iLCJtaW5SZWd
pc3RyYXRpb25MZXZlbCI6IkVYVEVOREVEIiwiZXhwaXJ5IjoxNTE3NTI2MDAwMDAwLCJvcmdhbmlzY
XRpb25JZCI6IHsgInRpdGxlIjoiVmVyaXNlYyBJRCIsICJpZGVudGlmaWVyTmFtZSI6IkRvbWFpbiB
uYW1lIiwgImlkZW50aWZpZXIiOiJ2ZWpvZG9lIiB9fQ==UPI userInfoType Example Request
If you wish to initiate an 'Add Organisation ID' request for a user with unique personal identifier '5633-823597-7862':
Create the JSON structure {"userInfoType":"UPI","userInfo":"5633-823597-7862","minRegistrationLevel":"EXTENDED","expiry":1517526000000,
"organisationId": { "title":"Frejviks kommun ID", "identifierName":"Domain name", "identifier":"vejodoe" }}
Encode the JSON structure to Base64.
Create the HTTP POST request with a POST parameter name initAddOrganisationIdRequest and the Base64 encoded JSON structure from the step 2 as its value.
The HTTP body should be the following (compact format, line broken for clarity only):
initAddOrganisationIdRequest=eyJ1c2VySW5mb1R5cGUiOiJVUEkiLCJ1c2VySW5mbyI6IjU2MzMtODIzNTk3LTc
4NjIiLCJtaW5SZWdpc3RyYXRpb25MZXZlbCI6IkVYVEVOREVEIiwiZXhwaXJ5IjoxNTE3NTI2MDAwMDAwLAoib3JnYW5
pc2F0aW9uSWQiOiB7ICJ0aXRsZSI6IkZyZWp2aWtzIGtvbW11biBJRCIsICJpZGVudGlmaWVyTmFtZSI6IkRvbWFpbiB
uYW1lIiwgImlkZW50aWZpZXIiOiJ2ZWpvZG9lIiB9fQ==INFERRED userInfoType Example Request
If you wish to initiate an 'Add Organisation ID' request for a user via a QR code:
Create the JSON structure {"userInfoType":"INFERRED","userInfo":"N/A","minRegistrationLevel":"EXTENDED","expiry":1517526000000,
"organisationId": { "title":"Frejviks kommun ID", "identifierName":"Domain name", "identifier":"vejodoe" }}Encode the JSON structure to Base64.
Create the HTTP POST request with a POST parameter name initAddOrganisationIdRequest and the Base64 encoded JSON structure from the step 2 as its value.
The HTTP body should be the following (compact format, line broken for clarity only):
initAddOrganisationIdRequest=eyJ1c2VySW5mb1R5cGUiOiJJTkZFUlJFRCIsInVzZXJJbmZvI
joiTi9BIiwibWluUmVnaXN0cmF0aW9uTGV2ZWwiOiJFWFRFTkRFRCIsImV4cGlyeSI6MTUxNzUyNjA
wMDAwMCwib3JnYW5pc2F0aW9uSWQiOiB7ICJ0aXRsZSI6IlZlcmlzZWMgSUQiLCAiaWRlbnRpZmllc
k5hbWUiOiJEb21haW4gbmFtZSIsICJpZGVudGlmaWVyIjoidmVqb2RvZSIgfX0=Example with identifierDisplayTypes and additionalAttributes
If you wish to initiate an 'Add Organisation ID' request for a user via a QR code:
Create the JSON structure {"userInfoType":"INFERRED","userInfo":"N/A","minRegistrationLevel":"EXTENDED","expiry":1517526000000,
"organisationId": { "title":"Frejviks kommun ID", "identifierName":"Domain name", "identifier":"vejodoe","identifierDisplayTypes":["QR_CODE","TEXT"],
"additionalAttributes":[{"key":"USER_ID","displayText":"ID","value":"123456789"}] }}Encode the JSON structure to Base64.
Create the HTTP POST request with a POST parameter name initAddOrganisationIdRequest and the Base64 encoded JSON structure from the step 2 as its value.
The HTTP body should be the following:
initAddOrganisationIdRequest=eyJ1c2VySW5mb1R5cGUiOiJJTkZFUlJFRCIsInVzZXJJbmZvIjoi
Ti9BIiwibWluUmVnaXN0cmF0aW9uTGV2ZWwiOiJFWFRFTkRFRCIsImV4cGlyeSI6MTUxNzUyNjAwMDAwM
CwKIm9yZ2FuaXNhdGlvbklkIjogeyAidGl0bGUiOiJWZXJpc2VjIElEIiwgImlkZW50aWZpZXJOYW1lIj
oiRG9tYWluIG5hbWUiLCAiaWRlbnRpZmllciI6InZlam9kb2UiLCJpZGVudGlmaWVyRGlzcGxheVR5cGV
zIjpbIlFSX0NPREUiLCJURVhUIl0sCiJhZGRpdGlvbmFsQXR0cmlidXRlcyI6W3sia2V5IjoiVVNFUl9J
RCIsImRpc3BsYXlUZXh0IjoiSUQiLCJ2YWx1ZSI6IjEyMzQ1Njc4OSJ9XSB9fQ==Possible Errors
Code Returned | Explanation |
|---|---|
0 | Internal error. |
1001 | Invalid or missing userInfoType. |
1002 | Invalid or missing userInfo. |
1003 | Invalid restrict. |
1004 | You are not allowed to call this method. |
1005 | User has disabled your service. |
1007 | Invalid min registration level. |
1008 | Unknown Relying Party. |
1009 | You are not allowed to request integratorSpecificUserId parameter. |
1010 | JSON request cannot be parsed. |
1012 | User with the specified userInfo does not exist in Freja eID database. |
4000 | Invalid or missing Organisation ID identifier. |
4002 | This Organisation ID identifier is already used. |
4003 | Invalid expiry. |
4004 | Invalid or missing Organisation ID title. |
4005 | Invalid or missing Organisation ID identifier name. |
4006 | Invalid or missing Organisation ID. |
4008 | Invalid display type. |
4009 | Invalid additional attributes. |
JSON Response Value
If HTTP 200 is returned from the method, the following return value will be present in the body of the response:
{
"orgIdRef":"Reference to be submitted in getOneResult method"
} |
|
Get One Organisation ID Result Method
The method is called using HTTP POST through the URLs below:
The method is called using HTTP POST through the URLs below:
Environment | Endpoint |
|---|---|
TEST |
|
PRODUCTION |
|
JSON Example for getOneOrganisationIdResultRequest
The parameter of the method is a Base64 UTF8-encoded JSON payload according to the following:
{
"orgIdRef":"Organisation ID reference"
}
| authRef: string, mandatory. The value must be equal to a reference previously returned from a call to the Initiate Add Organisation Method. The time period during which a specific reference is available for checking will depend on the longevity of the operation (see the expiry parameter in the Initiate Add Organisation Method) and is calculated as the expiry time plus 3 days. |
Example Request
If you wish to fetch an Organisation ID result with the reference previously returned from a call to initAddOrganisationIdRequest (for a user with an email address: joe.black@freja.com), follow these steps:
Create the JSON structure {"orgIdRef":"TrLA9zdxCBlNOQNvkdhAM14mJmlL20digC7+QgEVRwmE7SH8Qm0swWIc6whfKm4Y"}
Encode the JSON structure to Base64.
Create the HTTP POST request with a POST parameter name getOneOrganisationIdResultRequest and the Base64 encoded JSON structure from the step 2 as its value.
The HTTP body should be the following (compact format, line broken for clarity only):
getOneOrganisationIdResultRequest=eyJvcmdJZFJlZiI6IlRyTEE5emR4Q0JsTk9RTnZrZGh
BTTE0bUptbEwyMGRpZ0M3K1FnRVZSd21FN1NIOFFtMHN3V0ljNndoZkttNFkifQ==Possible Errors
Code Returned | Explanation |
|---|---|
1004 | You are not allowed to call this method. |
1008 | Unknown Relying Party. |
1100 | Invalid reference (for example, nonexistent or expired). |
JSON Response Value
If HTTP 200 is returned from the method, the following return value will be present in the body of the response:
{
"orgIdRef":"Organisation ID reference",
"status":"Authentication status",
"details":"JWS signed data"
} |
|
details
JWS in compact serialised form as following:
BASE64URL(UTF8(JWS Protected Header)) || ’.’ || BASE64URL(JWS Payload) || ’.’ || BASE64URL(JWS Signature)
JWS Protected Header | |
{
"x5t":"SHA-1 digest of the signing certificate",
"alg":"algorithm used to secure the JWS"
} |
|
JWS Payload | |
{
"orgIdRef":"Authentication reference",
"status":"Authentication status",
"userInfoType":"User info type",
"userInfo":"User information corresponding to user info type",
"minRegistrationLevel":"Minimum required registration level of a user",
"timestamp":"Time when transaction was approved by end user",
"signatureType":"Signature type",
"signatureData":{
"userSignature":"The signature produced by the end user",
"certificateStatus":"Evidence of end-users certificate status"
}
} |
|
Cancel Add Organisation ID Method
This method is used by a Relying Party to cancel an 'Add Organisation ID' request.
The method is called using HTTP POST through the URLs below:
Environment | Endpoint |
|---|---|
TEST |
|
PRODUCTION |
|
JSON Example for cancelAuthRequest
The parameter of the method is a Base64 UTF8-encoded JSON payload according to the following:
{
"orgIdRef":"Organisation ID reference"
} |
|
Example Request
If you wish to cancel an authentication request, follow these steps:
Create the JSON structure {"authRef":"GOHPyJcoKLJ+zKCEy4abi6jOO+q5VK+S1+UO5OXRmOPu42ixvVnsVgs7ADYUfG8m"}
Encode the JSON structure to Base64.
Create the HTTP POST request with a POST parameter name cancelAuth and the Base64 encoded JSON structure from the step 2 as its value.
The HTTP body should be the following (line broken for clarity only):
cancelAddOrganisationIdRequest=eyJvcmdJZFJlZiI6IlRyTEE5emR4Q0JsTk9RTnZrZGhBTTE
0bUptbEwyMGRpZ0M3K1FnRVZSd21FN1NIOFFtMHN3V0ljNndoZkttNFkifQ==Possible Errors
Code Returned | Explanation |
|---|---|
1004 | You are not allowed to call this method. |
1008 | Unknown Relying Party. |
1100 | Invalid reference (for example, nonexistent or expired). |
If HTTP 200 is returned from the method, the request was successfully fulfilled.
Update Organisation ID Method
This method is used by a Relying Party to update additional attributes for an existing Organisation ID.
The method is called using HTTP POST through the URLs below:
Environment | Endpoint |
|---|---|
TEST |
|
PRODUCTION |
|
JSON Example for updateOrganisationIdRequest
The parameter of the method is a Base64 UTF8-encoded JSON payload according to the following:
{
"identifier": "Value of specific organisation identifier",
"additionalAttributes": [
{
"key": "exampleKey",
"displayText": "Example display text",
"value": "Value of attribute"
}
]
} |
|
Example Request
If you wish to update an Organisation ID, follow these steps:
Create the JSON structure {"identifier": "vejodoe","additionalAttributes":[{"key": "exampleKey","displayText": "Example display text","value": "Value of attribute"}]}
Encode the JSON structure to Base64.
Create the HTTP POST request with a POST parameter name updateOrganisationIdRequest and the Base64 encoded JSON structure from the step 2 as its value.
The HTTP body should be the following (line broken for clarity only):
updateOrganisationIdRequest=eyJpZGVudGlmaWVyIjogInZlam9kb2UiLCJhZGRpdGlvbmF
sQXR0cmlidXRlcyI6W3sia2V5IjogImV4YW1wbGVLZXkiLCJkaXNwbGF5VGV4dCI6ICJFeGFtcG
xlIGRpc3BsYXkgdGV4dCIsInZhbHVlIjogIlZhbHVlIG9mIGF0dHJpYnV0ZSJ9XX0=Possible Errors
Code Returned | Explanation |
|---|---|
1004 | You are not allowed to call this method. |
1008 | Unknown Relying Party. |
4000 | Invalid or missing Organisation ID identifier. |
4001 | There is no user for given Organisation ID identifier. |
4009 | Invalid additional attributes. |
JSON Response Value
If HTTP 200 is returned from the method, the following return value will be present in the body of the response:
{
"updateStatus":{
"added":"1",
"updated":"1",
"deleted":"1"
}
} |
|