Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

include more details about the initialize endpoint #1938

Merged
merged 16 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,66 +21,73 @@ This endpoint prepares and queues a correspondence for sending. Before using thi

This API requires authentication, and the request must also include:

- Correspondence write scope __altinn:correspondence.write__ (for external system callers)
- Correspondence write scope **altinn:correspondence.write** (for external system callers)

See [Authentication and Authorization](/notifications/reference/api/#authentication--authorization) for more information.

## Request body
## Request

[You can see an example of a request body here](https://docs.altinn.studio/api/correspondence/spec/#/Correspondence/post_correspondence_api_v1_correspondence)
### Content-Type

## Response
application/json

### Response codes
### Request body

- 200 OK: The correspondence has been successfully initialized
The request body must contain the correspondence request formatted as an [InitializeCorrespondencesRequest](https://github.com/Altinn/altinn-correspondence/blob/main/src/Altinn.Correspondence.API/Models/InitializeCorrespondencesExt.cs)

Refer to problem details in the response body for further information.
- 401 Unauthorized: Indicates a missing, invalid, or expired authorization header.
- 403 Forbidden: Indicates that the required scope or Platform Access Token is missing or invalid.
### Required request properties

### Content-Type
#### correspondence

- application/json
Type: [BaseCorrespondenceExt](/correspondence/reference/api-endpoints/initialize/basecorrespondenceext/)

### Response body
The correspondence which is to be sent.


#### recipients

The response body returns a list of correspondences [InitializeCorrespondencesResponseExt](https://github.com/Altinn/altinn-correspondence/blob/main/src/Altinn.Correspondence.API/Models/InitializeCorrespondencesResponseExt.cs), with one correspondence for each recipient. Each correspondence can have multiple different recipients where each recipient will be given a unique correspondenceId, status, etc.
Type: _List\<string>_

### Response body properties
List of recipients for the correspondence. This can either be the organization number or the national identity number of the recipient.

#### correspondenceId
For *organization numbers*, the recipients must include the prefix `urn:altinn:organization:identifier-no` in front of the organization number. Example `urn:altinn:organization:identifier-no:123456789`

Type: _Guid_
For *national identity numbers*, the recipients must have the prefix `urn:altinn:person:identifier-no` in front of the identity number. Example `urn:altinn:person:identifier-no:01019912345`

The ID of the correspondence that has been initialized
### Optional request properties

#### status
#### existingAttachments

Type: _string_
Type: _List\<string>_

[The different statuses are defined here](https://github.com/Altinn/altinn-correspondence/blob/main/src/Altinn.Correspondence.API/Models/Enums/CorrespondenceStatusExt.cs)
List of attachment ID(s) for the attachment(s) which should be included with the correspondence(s). These must be uploaded using the **attachment** endpoint beforehand.

Shows the status of the initialized correspondence
## Response

### Response codes

#### recipient
- 200 OK: The correspondence has been successfully initialized
- 400 Bad Request: The request was invalid. Refer to problem details in the response body for further information.
- 401 Unauthorized: Indicates a missing, invalid, or expired authorization header.
- 403 Forbidden: Indicates that the required scope or Platform Access Token is missing or invalid.

Type: _string_
### Content-Type

- application/json

### Response body

Shows the recipient in the format 0192:{{recipientOrgNumber}}
The response body returns a list of correspondences [InitializeCorrespondencesResponseExt](https://github.com/Altinn/altinn-correspondence/blob/main/src/Altinn.Correspondence.API/Models/InitializeCorrespondencesResponseExt.cs), with one correspondence for each recipient.
Find a short description of each property below.

#### notifications
#### correspondences
Type: [List\<InitializedCorrespondencesExt>](/correspondence/reference/api-endpoints/initialize/initializedcorrespondencesext/)

Type: _List of [InitializedCorrespondencesNotificationsExt](https://docs.altinn.studio/api/correspondence/spec/#/Correspondence/post_correspondence_api_v1_correspondence)_
Information about the correspondences created in the request.
#### attachmentIds
Type: _List\<Guid>_

A list of the generated notifications with send results. Each notification will include the following properties:

- _orderId_: the ID of the order.
- _isReminder_: a boolean indicating whether the notification is a reminder or not.
- _status_: shows the status of the notification at the time of creating the correspondence(s).
The IDs of the attachments that were included with the correspondences

| Status | Description |
|:-----------------:|:---------------------------------------------------------------------------:|
| Success | Notification order was created successfully with contact information for __at least one__ of the recipients for the notification. |
| MissingContact | Contact information was not found for __any of__ the recipients for the notification at the time of creating the correspondence. |
| Failure | Creating notification order failed due to an error.|
<!-- ## Examples -->
Original file line number Diff line number Diff line change
Expand Up @@ -21,62 +21,69 @@ Dette endepunktet oppretter en melding og legger den i kø for sending. Før du

Dette API-et krever autentisering, og forespørselen må også inkludere:

- Correspondence write scope __altinn:correspondence.write__ (for eksterne kall)
- Correspondence write scope **altinn:correspondence.write** (for eksterne kall)

Se [Autentisering og Autorisasjon](/notifications/reference/api/#authentication--authorization) for mer informasjon.

## Request body

[Du kan se et eksempel på en request body her](https://docs.altinn.studio/api/correspondence/spec/#/Correspondence/post_correspondence_api_v1_correspondence)
### Content-Type (Innholdstype)

## Respons
- application/json

### Responskoder
### Request body

- 200 OK: Responsen har blitt vellykket initialisert
Request body må bestå av melding(er) i requesten på formatet i [InitializeCorrespondencesRequest](https://github.com/Altinn/altinn-correspondence/blob/main/src/Altinn.Correspondence.API/Models/InitializeCorrespondencesExt.cs)

Se problemdetaljer i responskroppen for mer informasjon.
- 401 Unauthorized: Indikerer en manglende, ugyldig eller utløpt autorisasjonsheader.
- 403 Forbidden: Indikerer at nødvendig omfang eller plattformtilgangstoken mangler eller er ugyldig.
### Påkrevde felter i requesten

### Innholdstype
#### correspondence

- application/json
Type: [BaseCorrespondenceExt](/correspondence/reference/api-endpoints/initialize/basecorrespondenceext/)

Meldingen(e) som skal opprettes.

#### recipients

### Response body
Type: _List\<string>_

Respons body returnerer en liste over meldinger [InitializeCorrespondencesResponseExt](https://github.com/Altinn/altinn-correspondence/blob/main/src/Altinn.Correspondence.API/Models/InitializeCorrespondencesResponseExt.cs), med en melding for hver mottaker. Hver melding kan ha flere forskjellige mottakere hvor hver mottaker vil få en unik correspondenceId, status, etc.
Liste of mottakere til meldingen(ene). Dette kan enten være organisasjonsnummer eller personnummer.

### Response body egenskaper
For _organisasjonsnummer_, er mottakerne nødt til å ha med prefiksen `urn:altinn:organization:identifier-no` foran organisasjonsnummeret. For eksempel "urn:altinn:organization:identifier-no:123456789"

#### correspondenceId
Type: _Guid_
For _personnummer_, the must have the prefix `urn:altinn:person:identifier-no` in front of the identity number. For eksempel "urn:altinn:person:identifier-no:01019912345"

ID-en til meldingen som har blitt initialisert
### Valgfrie felter i requesten

#### status
Type: _string_
#### existingAttachments

[De forskjellige statusene er definert her](https://github.com/Altinn/altinn-correspondence/blob/main/src/Altinn.Correspondence.API/Models/Enums/CorrespondenceStatusExt.cs)
Type: _List\<string>_

Liste med ID(er) til vedlegg(ene) som skal inkluderes med meldingen(e). Disse må lastes opp på forhånd ved å bruke **attachment** sitt endepunkt.

## Respons

### Responskoder

- 200 OK: Responsen har blitt vellykket initialisert
- 400 Bad Request: Requesten var ugyldig. Se problemdetaljer i responskroppen for mer informasjon.
- 401 Unauthorized: Indikerer en manglende, ugyldig eller utløpt autorisasjonsheader.
- 403 Forbidden: Indikerer at nødvendig omfang eller plattformtilgangstoken mangler eller er ugyldig.

Viser statusen til den initialiserte meldingen
### Content-Type (Innholdstype)

#### recipient
Type: _string_
application/json

Viser mottakeren i formatet 0192:{{recipientOrgNumber}}
### Response body

#### notifications
Type: _Liste over [InitializedCorrespondencesNotificationsExt](https://docs.altinn.studio/api/correspondence/spec/#/Correspondence/post_correspondence_api_v1_correspondence)_
Respons body returnerer en liste over meldinger [InitializeCorrespondencesResponseExt](https://github.com/Altinn/altinn-correspondence/blob/main/src/Altinn.Correspondence.API/Models/InitializeCorrespondencesResponseExt.cs), med en melding for hver mottaker.
Nedenfor er en kort beskrivelse av hver av feltene.

En liste over de genererte varslene med sendingsresultat. Hvert varsel vil inkludere følgende egenskaper:
#### correspondences
Type: [List\<InitializedCorrespondencesExt>](/correspondence/reference/api-endpoints/initialize/initializedcorrespondencesext/)

- _orderId_: ID-en til ordren.
- _isReminder_: en boolsk verdi som indikerer om varselet er en påminnelse eller ikke.
- _status_: viser statusen til varselet i det tidspunktet meldingen(e) ble opprettet.
Informasjon on meldingen(e) som ble opprettet.
#### attachmentIds
Type: _List\<Guid>_

| Status | Beskrivelse |
|:-----------------:|:---------------------------------------------------------------------------:|
| Success | Varselordren ble opprettet vellykket med kontaktinformasjon til __minst en__ av mottakerne til varslingen. |
| MissingContact | Kontaktinformasjon ble __ikke funnet for noen__ av mottakerne av varslingen. |
| Failure | Opprettelse av varselordre mislyktes på grunn av en feil. |
ID(ene) til vedleggene som ble inkludert med meldingen(e).
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
---
title: BaseCorrespondenceExt
linktitle: BaseCorrespondenceExt
description: Description of the properties for the object

weight: 60
toc: true
---
Link to [BaseCorrespondenceExt](https://github.com/Altinn/altinn-correspondence/blob/main/src/Altinn.Correspondence.API/Models/BaseCorrespondenceExt.cs)

Represents a request object for the operation, InitializeCorrespondence, that can create a correspondence in Altinn.

### resourceId

Type: _string_

The ID for the resource associated with the correspondence

### sender

Type: _string_

The sender of the correspondence.

### sendersReference

Type: _string_

Used by senders and receiver to identify a specific Correspondence using external identification methods.

### messageSender

Type: _string?_

An alternative name for the sender of the correspondence. The name will be displayed instead of the organization name.

### content

Type: [InitializeCorrespondenceContentExt](/correspondence/reference/api-endpoints/initialize/initializecorrespondencecontentext)

The correspondence content. Contains information about the title, body, etc.

### requestedPublishTime

Type: _DateTimeOffset?_

When the correspondence should become visible to the recipient.
If value is set to `null` during initialization, the correspondence is published immediately.

### allowSystemDeleteAfter

Type: _DateTimeOffset?_

The date for when Altinn can remove the correspondence from its database

### dueDateTime

Type: _DateTimeOffset?_

The date and time for when the recipient must reply/confirm.

### externalReferences

Type: [List\<ExternalReferencesExt>?](https://github.com/Altinn/altinn-correspondence/blob/main/src/Altinn.Correspondence.API/Models/ExternalReferenceExt.cs)

A list of references senders can use to tell the recipient that the correspondence is related to the referenced item(s).
Examples include Altinn App instances, Altinn Broker file transfers.

### propertyList

Type: _Dictionary\<string, string>_

User-defined properties related to the Correspondence.

### replyOptions

Type: [List\<CorrespondenceReplyOptions>](https://github.com/Altinn/altinn-correspondence/blob/main/src/Altinn.Correspondence.API/Models/CorrespondenceReplyOptionExt.cs)

Options for how the recipient can reply to the correspondence by accessing one or more URLs.

### notification

Type: [InitializeCorrespondenceNotificationExt?](/correspondence/reference/api-endpoints/initialize/initializecorrespondencenotificationext)

Notifications directly related to the correspondence

### ignoreReservation

Type: _bool?_, false if not specified otherwise

Specifies whether the correspondence can override reservation against digital communication in the __Contact and Reservation Register (KRR)__

### published

Type: _DateTimeOffset?_

The date and time of which the correspondence was published. This value is set automatically after the correspondence has been published.

### isConfirmationNeeded

Type: _bool?_, false if not specified otherwise

Specifies whether the recipient must confirm the correspondence have been read.
If confirmation is needed and the recipient has not confirmed the correspondence within the due date, this will result in the event `CorrespondenceRecipientNeverConfirmed` being published.
Loading
Loading