Skip to content

Commit 307f6df

Browse files
authored
Merge pull request #214 from digipost/doc-updates
Add some more info about request-for-registration
2 parents b9cd243 + 2c9857e commit 307f6df

File tree

1 file changed

+44
-19
lines changed

1 file changed

+44
-19
lines changed

docs/_v14_0/2_send_messages.md

Lines changed: 44 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,10 @@ var message = new Message(
3333

3434
var result = client.SendMessage(message);
3535
```
36+
3637
### Other recipient types
3738

38-
There are other recipient types available to identify recipients of messages. Note that some recipient types may
39+
There are other recipient types available to identify recipients of messages. Note that some recipient types may
3940
require special permissions to be set up in order to be used.
4041

4142
```csharp
@@ -117,13 +118,18 @@ var messageWithFallbackToPrint = new Message(sender, recipient, primaryDocument)
117118
var result = client.SendMessage(messageWithFallbackToPrint);
118119
```
119120

120-
### Send messaage with request for registration
121+
### Send message with request for registration
122+
123+
It is possible to send a message to a person who does not have a Digipost account, where the message triggers
124+
an SMS notification with a request for registration. The SMS notification says that if they register for a
125+
Digipost account the document will be delivered digitally.
126+
127+
The actual content of the SMS is not part of the request, it is stored as part of the Digipost sender account and must be agreed upon with Digipost, as well as the SMS sender ID or phone number.
121128

122-
It is possible to send a message to a person, who does not have a Digipost account, where the message triggers
123-
an SMS notification with a request for registration. The SMS notification says that if they register for a
124-
Digipost account the document will be delivered digitally. The actual content of the SMS is not part of the request, it is stored as part of the Digipost sender account and must be agreed upon with Digipost. If the user does not register for a Digipost
125-
account within the defined deadline, the document will be either delivered as physical mail or not at all.
126-
Be aware that PersonalIdentificationNumber as Recipient is required to be able to deliver the document to the correct person.
129+
If the user does not register for a Digipost account within the defined deadline, the document will be either delivered as physical mail or not at all.
130+
Be aware that using `PersonalIdentificationNumber` is required as Recipient to be able to deliver the document to the correct person.
131+
132+
It is important to include the country code, starting with a plus sign, in the recipient's phone number.
127133

128134
In the following the document will be delivered as physical mail by Digipost if the recipient has not registered for a Digipost account by the defined deadline:
129135

@@ -158,14 +164,30 @@ var messageWithRequestForRegistration = new Message(sender, recipient, primaryDo
158164
var result = client.SendMessage(messageWithRequestForRegistration);
159165
```
160166

161-
If the sender wishes to send the document as physical mail through it's own
162-
service, print details _must not be included_. In that case the status of the delivery can be checked with the following:
167+
If the sender wishes to send the document as physical mail through its own
168+
service, print details _must not be included_ but be `null` instead.
169+
170+
````csharp
171+
var recipient = new RecipientById(identificationType: IdentificationType.PersonalIdentificationNumber, id: "311084xxxx");
172+
var documentGuid = Guid.NewGuid();
173+
174+
var requestForRegistration = new RequestForRegistration(
175+
DateTime.Now.AddDays(3),
176+
"+4711223344",
177+
null,
178+
null
179+
);
180+
```
181+
182+
In this case the status of the delivery can be checked with the following:
163183

164184
```csharp
165185
var documentStatus = _digipostClient.GetDocumentStatus(sender).GetDocumentStatus(documentGuid).Result;
166186
```
167187

168-
The documentGuid is tha same as the one used when the originating message was sent.
188+
If documentDeliveryStatus is still "NOT_DELIVERED" after the expiry date, you know that the user did not register a Digipost account and the document is not delivered.
189+
190+
The documentGuid is the same as the one used when the originating message was sent.
169191

170192
### Send letter with fallback to print if the user does not read the message within a certain deadline
171193

@@ -312,7 +334,7 @@ if (identificationResponse.ResultType == IdentificationResultType.DigipostAddres
312334
{
313335
//Exist as user in Digipost.
314336
//If you used personal identification number to identify - use this to send a message to this individual.
315-
//If not, see Data field for DigipostAddress.
337+
//If not, see Data field for DigipostAddress.
316338
}
317339
else if (identificationResponse.ResultType == IdentificationResultType.Personalias)
318340
{
@@ -393,8 +415,8 @@ var result = client.SendMessage(message);
393415
There are other enrichments that are available in Digipost. Ref.
394416
https://github.com/digipost/digipost-data-types-dotnet or the original project (for java) https://github.com/digipost/digipost-data-types.
395417
396-
397418
### Search for receivers
419+
398420
A central part of a user interface in the application that is integrating with Digipost is the possiblity to search for receivers. This is available via the search endpoint. A person can be found by simply searching by first name and last name, e.g. <code>Ola Nordmann</code>, or specified further by street address, postal code, city and organization name.
399421

400422
It is important to note that the search results returned do not necessarily include the receiver to which you actually wish to send. The search results returned are strictly based on the search query you have sent in. This equally applies when only one search result is returned. This means that the actual person to which you wish to send must be confirmed by a human being before the actual document i sent (typically in the senders application). If the goal is to create a 100% automated workflow then the identify recipient endpoint should be used (see Identify recipient use case).
@@ -410,6 +432,7 @@ foreach (var person in response.PersonDetails)
410432
```
411433

412434
### Send on behalf of organization
435+
413436
In the following use case, `Sender` is defined as the party who is responsible for the actual content of the letter. `Broker` is defined as the party who is responsible for the technical transaction, which in this context means creating the request and being the party that is authenticated.
414437

415438
![example]({{ site.baseurl}}/assets/images/sender_broker_digipost.png)
@@ -418,7 +441,7 @@ Sending on behalf of an organization is accomplished by setting `Message.Sender`
418441

419442
<blockquote> Remember to use the enterprise certificate of the broker to sign the message, not the one belonging to the sender. Also, the proper permissions need to be set by Digipost to send on behalf of an organization.</blockquote>
420443

421-
Let us illustrate this with an example. Let _BrokerCompany_ be an organization with id _12345_, and thumbprint of their certificate _84e492a972b7e..._. They want to send on behalf of _SenderCompany_ with organization id _67890_.
444+
Let us illustrate this with an example. Let _BrokerCompany_ be an organization with id _12345_, and thumbprint of their certificate _84e492a972b7e..._. They want to send on behalf of _SenderCompany_ with organization id _67890_.
422445

423446
```csharp
424447
var broker = new Broker(12345);
@@ -463,7 +486,7 @@ available datatypes and their documentation can be found at
463486
[digipost/digipost-data-types](https://github.com/digipost/digipost-data-types).
464487
465488
DataTypes are sent as an XML string in the document's `datatype` field. You can build the XML yourself, or import our extension library [Digipost.Api.Client.DataTypes](https://www.nuget.org/packages/Digipost.Api.Client.DataTypes.Core/).
466-
This library includes classes for each datatype, which can be serialized using `SerializeUtil.Serialize(DataType)`, which gives you the XML string to append to the document.
489+
This library includes classes for each datatype, which can be serialized using `SerializeUtil.Serialize(DataType)`, which gives you the XML string to append to the document.
467490
The expansion library is optional, but highly recommended if you'll be working with DataTypes. The examples below will assume the usage of said library.
468491

469492
### Send message with appointment datatype
@@ -490,6 +513,7 @@ var document = new Document(
490513

491514
// Create Message and send using the client as specified in other examples.
492515
```
516+
493517
### Send message with event datatype
494518

495519
`Event` represents a meeting set for a specific place, but covering multiple time spans. The following example demonstrates how to include such extra data:
@@ -530,6 +554,7 @@ Document document = new Document(
530554

531555
// Create Message and send using the client as specified in other examples.
532556
```
557+
533558
### Send message with external link datatype
534559

535560
`ExternalLink` enhances a message in Digipost with a button which sends the user to an external site. The button
@@ -556,10 +581,9 @@ var document = new Document(
556581
// Create Message and send using the client as specified in other examples.
557582
```
558583

559-
560584
### Get status of a sent document
561585

562-
You can for any given document check its status to see if it and when has been delivered, status of
586+
You can for any given document check its status to see if it and when has been delivered, status of
563587
read approval, delivery method etc.
564588

565589
To do this you need to have the Guid given to the document.
@@ -586,13 +610,13 @@ To fetch fhe DocumentStatus later:
586610
var documentStatus = _digipostClient.GetDocumentStatus(sender).GetDocumentStatus(documentGuid).Result;
587611
```
588612

589-
This can be useful if you use fallback to print, print-if-unread, request for registration etc.
613+
This can be useful if you use fallback to print, print-if-unread, request for registration etc.
590614

591615
### Get Sender by organisation number and a part id and send a message
592616

593617
In very specific usecases where a broker organisation has multiple sub-organisations in Digipost
594-
it is possible to send with organisation number and a partid. The partid can be used to distinguish
595-
between different divisions or however the organisation sees fit. This makes it possible
618+
it is possible to send with organisation number and a partid. The partid can be used to distinguish
619+
between different divisions or however the organisation sees fit. This makes it possible
596620
to not have to store the Digipost account id, but in stead fetch this information from the api.
597621

598622
```csharp
@@ -606,3 +630,4 @@ var message = new Message(
606630

607631
var result = client.SendMessage(message);
608632
```
633+
````

0 commit comments

Comments
 (0)