Package no.digipost.api.client
Class DigipostClient
java.lang.Object
no.digipost.api.client.DigipostClient
En klient for å sende brev gjennom Digipost. Hvis et objekt av denne klassen
er opprettet med et fungerende sertifikat og tilhørende passord, kan man
gjøre søk og sende brev gjennom Digipost.
-
Constructor Summary
ConstructorsConstructorDescriptionDigipostClient
(DigipostClientConfig config, BrokerId brokerId, Signer signer) DigipostClient
(DigipostClientConfig config, BrokerId brokerId, Signer signer, org.apache.http.impl.client.HttpClientBuilder clientBuilder) DigipostClient
(DigipostClientConfig config, MessageDeliveryApi apiService, InboxApi inboxApiService, DocumentApi documentApi, ArchiveApi archiveApi, BatchApi batchApi, TagApi tagApi, SharedDocumentsApi sharedDocumentsApi) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addData
(AddDataLink addDataLink, AdditionalData data) void
addUniqueUUIDToArchiveDocument
(UUID uuid, UUID newuuid) addUniqueUUIDToArchiveDocument
(SenderId senderId, UUID uuid, UUID newuuid) archiveDocuments
(Archive archive) void
cancelBatch
(Batch batch) completeBatch
(Batch batch) createBatch
(UUID batchUUID) createMessage
(Message message) Oppretter en forsendelse for sending gjennom Digipost.createOrActivateUserAccount
(SenderId senderId, UserInformation user) createPrintOnlyMessage
(Message printMessage) Opprette forsendelse som skal gå direkte til print og videre til utsending gjennom vanlig postgang.void
deleteArchiveDocument
(URI archiveDocument) void
deleteInboxDocument
(InboxDocument inboxDocument) Delets the given document from the servergetArchiveDocumentByUuid
(SenderId senderId, UUID uuid) getArchiveDocuments
(URI uri) An Archive has an optional URL to fetch documents paged 100 at a time.getArchiveDocumentsByReferenceId
(SenderId senderId, String referenceId) Get a list of all the archivesgetArchives
(SenderId senderId) Get a list of all the archives for the organisation represented by senderId.getAutocompleteSuggestions
(String searchString) getBatchInformation
(UUID batchUUID) getContent
(String path) getDocumentEvents
(String organisation, String partId, ZonedDateTime from, ZonedDateTime to, int offset, int maxResults) getDocumentEvents
(ZonedDateTime from, ZonedDateTime to, int offset, int maxResults) getDocumentEvents
(SenderId senderId, ZonedDateTime from, ZonedDateTime to, int offset, int maxResults) getDocumentStatus
(Link linkToDocumentStatus) getDocumentStatus
(SenderId senderId, UUID uuid) Get the first 100 documents in the inbox for the organisation represented by senderId.Get documents from the inbox for the organisation represented by senderId.getInboxDocumentContent
(InboxDocument inboxDocument) Get the content of a document as a stream.getSenderInformation
(String orgnr, String avsenderenhet) Hent informasjon om en gitt avsender.getSenderInformation
(SenderId senderId) Hent informasjon om en gitt avsender.getShareDocumentsRequestState
(SenderId senderId, UUID shareDocumentsRequestUuid) getTags
(PersonalIdentificationNumber personalIdentificationNumber) identifyRecipient
(Identification identification) void
org.apache.http.client.methods.CloseableHttpResponse
stopSharing
(SenderId senderId, URI uri) updateArchiveDocument
(ArchiveDocument archiveDocument, URI uri)
-
Constructor Details
-
DigipostClient
-
DigipostClient
public DigipostClient(DigipostClientConfig config, BrokerId brokerId, Signer signer, org.apache.http.impl.client.HttpClientBuilder clientBuilder)
-
-
Method Details
-
createMessage
Oppretter en forsendelse for sending gjennom Digipost. Dersom mottaker ikke er digipostbruker og det ligger printdetaljer på forsendelsen bestiller vi print av brevet til vanlig postgang. (Krever at avsender har fått tilgang til print.) -
createPrintOnlyMessage
Opprette forsendelse som skal gå direkte til print og videre til utsending gjennom vanlig postgang. Krever at avsender har tilgang til å sende direkte til print. -
identifyRecipient
-
addData
-
search
-
getAutocompleteSuggestions
-
getDocumentEvents
public DocumentEvents getDocumentEvents(ZonedDateTime from, ZonedDateTime to, int offset, int maxResults) -
getDocumentEvents
public DocumentEvents getDocumentEvents(SenderId senderId, ZonedDateTime from, ZonedDateTime to, int offset, int maxResults) -
getDocumentEvents
public DocumentEvents getDocumentEvents(String organisation, String partId, ZonedDateTime from, ZonedDateTime to, int offset, int maxResults) -
getSenderInformation
Hent informasjon om en gitt avsender. Kan enten be om informasjon om "deg selv", eller en avsender du har fullmakt til å sende post for.- Parameters:
senderId
- avsender-IDen til avsenderen du vil ha informasjon om.- Returns:
- informasjon om avsenderen, dersom den finnes, og du har tilgang til å informasjon om avsenderen. Det er ikke mulig å skille på om avsenderen ikke finnes, eller man ikke har tilgang til informasjonen.
- See Also:
-
getSenderInformation
Hent informasjon om en gitt avsender. Kan enten be om informasjon om "deg selv", eller en avsender du har fullmakt til å sende post for.- Parameters:
orgnr
- organisasjonsnummeret til avsenderen (påkrevet).avsenderenhet
- underenhet for gittorgnr
, dersom aktuelt, ellernull
.- Returns:
- informasjon om avsenderen, dersom den finnes, og du har tilgang til å informasjon om avsenderen. Det er ikke mulig å skille på om avsenderen ikke finnes, eller man ikke har tilgang til informasjonen.
- See Also:
-
getDocumentStatus
-
getDocumentStatus
-
getContent
-
getArchives
Get a list of all the archives- Returns:
- An Archives contains a list of archives
-
getArchives
Get a list of all the archives for the organisation represented by senderId.- Parameters:
senderId
- Either an organisation that you operate on behalf of or your brokerId- Returns:
- An Archives contains a list of archives
-
getArchiveDocuments
An Archive has an optional URL to fetch documents paged 100 at a time. Eg.: `archive.getNextDocuments()` It can also be used by the url supplied by `archive.getNextDocumentsWithAttributes(Map.of("MyKey", "MyVal")` This will return paged results that matches the attributes supplied. More attributes narrows the search (S1 AND S2).- Parameters:
uri
- URI supplied by the api with Relation NEXT_DOCUMENTS- Returns:
- An archive with documents.
-
getInbox
Get the first 100 documents in the inbox for the organisation represented by senderId.- Parameters:
senderId
- Either an organisation that you operate on behalf of or your brokerId- Returns:
- Inbox element with the 100 first documents
-
getInbox
Get documents from the inbox for the organisation represented by senderId.- Parameters:
senderId
- Either an organisation that you operate on behalf of or your brokerIdoffset
- Number of documents to skip. For paginationlimit
- Maximum number of documents to retrieve (max 1000)- Returns:
- Inbox element with the n=limit first documents
-
getInboxDocumentContent
Get the content of a document as a stream. The content is streamed from the server so remember to close the stream to prevent connection leaks.- Parameters:
inboxDocument
- The document to get content for- Returns:
- Entire content of the document as a stream
-
deleteInboxDocument
Delets the given document from the server- Parameters:
inboxDocument
- The document to delete
-
createOrActivateUserAccount
-
addTag
-
removeTag
-
getTags
-
stopSharing
-
archiveDocuments
-
getArchiveDocumentByUuid
-
getArchiveDocumentByUuid
-
addUniqueUUIDToArchiveDocument
-
addUniqueUUIDToArchiveDocument
-
getArchiveDocumentsByReferenceId
-
getArchiveDocumentContent
-
getArchiveDocumentContentStream
-
deleteArchiveDocument
-
updateArchiveDocument
-
createBatch
-
getBatchInformation
-
completeBatch
-
cancelBatch
-