Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Beskrivning

Möjlighet att skicka mail till en medborgares eller ett företags digitala brevlåda.

För tillfället stödjs enbart Kivra, men detta kommer att utökas till Min myndighetspost samt Eboks.

Digimail kommer inte stödjas pga: “Digimail har sagt upp anslutningsavtalet för Mina meddelanden. Det innebär att det från den 1 juni 2022 inte längre är möjligt att ta emot digital post från offentliga aktörer i Digimail från den 1 juni 2022 inte längre är möjligt att ta emot digital post från offentliga aktörer i Digimail

Användning av tjänsten

Denna tjänst har en del riktliner för hur meddelanden bör utformas och hur stora bilagor som kan bifogas:

Utforming av meddelanden

  • Ett komplett meddelande får vara max 2 MB, inklusive bilagor och meddelande. Tjänsten gör en kontroll på detta och kommer att ge ett felmeddelande om det är för stort.

    • Anledningen är helt enkelt att inte alla brevlådeoperatörer stödjer större meddelanden.

  • Varje meddelande måste ha ett icke-tomt meddelande (body), utöver eventuell bilaga, som kan vara antingen av typen vanlig text eller html.

Bilagor

  • Det går att skicka med 0 → n bilagor till ett meddelande. För tillfället stödjer vi enbart pdf-bilagor.

  • Bilagorna måste base64-encodas, ingen kontroll görs på deras “korrekthet” så detta är upp till avsändaren att säkerställa.

    • Tänk på att base64-encodning lägger på ~33% till storleken av pdf:en.

  • Samtliga bilagor inklusive meddelandet måste vara under 2MB i storlek annars nekar tjänsten utskicket.

    • Max-storleken beräknas på hela meddelandet som skickas så om det är exakt 2MB kommer det att nekas pga. den overhead som SOAP-meddelandet lägger på.

Livscykelstatus

Under utveckling

Lösningsbeskrivning

Gliffy
imageAttachmentIdatt975798291
macroId3aec7bee-a29e-4a2e-a8c2-e3c2e70b79f0
baseUrlhttps://sundsvall.atlassian.net/wiki
namedigital-mail-sender-gliffy
diagramAttachmentIdatt976420878
containerId892960792
timestamp1648563694238

Hantering av personuppgifter

I fallet där ett digitalt mail skall skickas till en medborgare hämtas personnummer via CitizenMapping då personnummer är tvingande för att få reda på vilken bredvlåda medborgaren har.

API specifikation (wip)

Swagger ui
openapi: 3.0.1
info:
  title: digitalapi-maildigitalmailsender
  contact: {}
  license:
    name: MIT License
    url: https://opensource.org/licenses/MIT
  version: "1.0"
servers:
- url: http://nowhere-for-now:8740
tags:
- name: Digital Mail
paths:
  /sendSimpleDigitalMail/{partyId}sendDigitalMail:
    post:
      tags:
      - Digital Mail
      operationId: sendSimpleDigitalMailsendDigitalMail
      parametersrequestBody:
       - namecontent:
 partyId         in: pathapplication/json:
            requiredschema:
    true          schema$ref: '#/components/schemas/DigitalMailRequest'
         typerequired: stringtrue
      responses:
   description: partyId    "404":
      example: 6a5c3d04-412d-11ec-973a-0242ac130003   description: Not Found
 requestBody:         content:
            application/json:
              schema:
                $ref: '#/components/schemas/SendDigitalMailRequest'
        required: trueProblem'
      responses:         "400"500":
          description: Internal BadServer RequestError
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Problem'
        "404400":
          description: NotBad FoundRequest
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Problem'
        "200":
          description: Successful Operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DigitalMailResponse'
  /api-docs:
     "500"get:
      tags:
   description: Internal Server Error- API
      summary: OpenAPI
 content:     operationId: getApiDocs
      application/jsonresponses:
        "200":
     schema:     description: OK
          $refcontent:
'#/components/schemas/Problem'   /sendSecureDigitalMail/{partyId}:     post:    application/yaml:
  tags:       - Digital Mail   schema:
   operationId: sendSecureDigitalMail       parameters:     type: string
- name: partyId    x-auth-type: None
    in: path x-throttling-tier: Unlimited
      requiredx-wso2-mutual-ssl: trueOptional
components:
  schemas:
    schemaAttachment:
      required:
   type: string  - body
      - description:contentType
partyId      - filename
   example: 6a5c3d04-412d-11ec-973a-0242ac130003  type: object
   requestBody   properties:
        contentcontentType:
          application/jsontype: string
           schemadescription: "Allowed type is: application/pdf"
          $refexample: '#/components/schemas/SecureDigitalMailRequest' APPLICATION_PDF
          requiredenum:
   true       responses:- application/pdf
        "400"body:
          descriptiontype: Badstring
Request           contentdescription: Base64-encoded body
          application/jsonfilename:
          type: string
  schema:        description: The name of the file
   $ref: '#/components/schemas/Problem'      example: sample.pdf
 "404":     description: "An attachment, e.g. pdf, docx description:etc."
Not Found   BodyInformation:
       content:
            application/json:
              schema:
                $ref: '#/components/schemas/Problem'
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Problem'
        "200":
          description: Successful Operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SecureDigitalMailResponse'
  /api-docs:
    get:
      tags:
      - API
      summary: OpenAPI
      operationId: getApiDocs
      responses:
        "200":
          description: OK
          content:
            application/yaml:
              schema:
                type: string
      x-auth-type: None
      x-throttling-tier: Unlimited
      x-wso2-mutual-ssl: Optional
components:
  schemas:
    BodyInformation:
      required:
      - body
      - contentType
      type: object
      properties:
        contentType:
          type: string
          description: "The content type for the message, text/plain for only text,\
            \ text/html for html messages."
          example: TEXT_PLAIN
          enum:
          - text/plain
          - text/html
        body:
          type: string
          description: "Base64 encoded representation of the message, must be UTF-8\
            \ encoded."
          example: PG5hdj4KICA8dWw+Cgk8bGk+PGEgaHJlZj0iaHR0cDovL2dvb2dsZS5jb20iIHRpdGxlPSJMb3J1bSBpcHN1bSBkb2xvciBzaXQgYW1ldCI+TG9yZW08L2E+PC9saT4KCTxsaT48YSBocmVmPSIjbm93aGVyZSIgdGl0bGU9IkFsaXF1YW0gdGluY2lkdW50IG1hdXJpcyBldSByaXN1cyI+QWxpcXVhbTwvYT48L2xpPgoJPGxpPjxhIGhyZWY9IiNub3doZXJlIiB0aXRsZT0iTW9yYmkgaW4gc2VtIHF1aXMgZHVpIHBsYWNlcmF0IG9ybmFyZSI+TW9yYmk8L2E+PC9saT4KCTxsaT48YSBocmVmPSIjbm93aGVyZSIgdGl0bGU9IlByYWVzZW50IGRhcGlidXMsIG5lcXVlIGlkIGN1cnN1cyBmYXVjaWJ1cyI+UHJhZXNlbnQ8L2E+PC9saT4KCTxsaT48YSBocmVmPSIjbm93aGVyZSIgdGl0bGU9IlBlbGxlbnRlc3F1ZSBmZXJtZW50dW0gZG9sb3IiPlBlbGxlbnRlc3F1ZTwvYT48L2xpPgogIDwvdWw+CjwvbmF2Pg==
      description: "The body of the message, base64 encoded"
    EmailNotification:
      required:
      - from
      type: object
      properties:
        from:
          type: string
          description: Who the digital mail is from
          example: someone@sundsvall.se
        subject:
          maxLength: 254
          minLength: 0
          type: string
          description: Title for notification email
          example: Du har ett nytt meddelande i Kivra
        text:
          type: string
          description: Notification message in the email
          example: Du har ett nytt meddelande i Kivra
      description: Email notification details
    Notification:
      type: object
      properties:
        emailNotification:
          $ref: '#/components/schemas/EmailNotification'
        smsNotification:
          $ref: '#/components/schemas/SmsNotification'
      description: Setting for notifying the recipient via via sms and/or email.
    SendDigitalMailRequest:
      required:
      - bodyInformation
      - headerSubject
      - municipalityId
      - supportInfo
      type: object
      properties:
        municipalityId:
          type: string
          description: MunicipalityId
          example: SK
        headerSubject:
          type: string
          description: The subject of the digital mail.
          example: Viktig information från Sundsvalls kommun
        supportInfo:
          $ref: '#/components/schemas/SupportInfo'
        bodyInformation:
          $ref: '#/components/schemas/BodyInformation'
        notification:
          $ref: '#/components/schemas/Notification'required:
      - description:body
Digital mail request    - SmsNotification:contentType
      type: object
      properties:
        fromcontentType:
          maxLengthtype: 11string
          minLengthdescription: 0"The content type for the message, text/plain for only text,\
 type: string          \ description: Number for notificationtext/html for html messages."
          example: "46701234567"TEXT_HTML
        text:  enum:
        maxLength: 160 - text/plain
        minLength: 0 - text/html
        typebody:
 string         type: string
description: Notification message in the sms     description: "Base64 encoded representation of the example:message, Dumust har ett nytt meddelande i Kivrabe UTF-8\
          description: Sms notification\ detailsencoded."
    SupportInfo:       required:example: PCFET0NUWVBFIGh0bWw+PGh0bWwgbGFuZz0iZW4iPjxoZWFkPjxtZXRhIGNoYXJzZXQ9InV0Zi04Ij48dGl0bGU+VGVzdDwvdGl0bGU+PC9oZWFkPjxib2R5PjxwPkhlbGxvPC9wPjwvYm9keT48L2h0bWw+
      -description: supportText"The body of the message, base64 encoded"
type: object   DigitalMailRequest:
   properties:   required:
     supportText: - bodyInformation
      - headerSubject
type: string     - municipalityId
    description: Information text- describingpartyId
the different ways the recipient  - supportInfo
      type: object
 may contact the sender.  properties:
        examplepartyId:
Kontakta oss via epost eller telefon.     type: string
    contactInformationUrl:      description: partyId for the person type:or stringorganization the digital mail should
      description: Url where the recipient may findbe moresent information.to
          example: https://sundsvall.se/6a5c3d04-412d-11ec-973a-0242ac130003
        contactInformationPhoneNumbermunicipalityId:
          type: string
          description: PhoneMunicipalityId
number the recipient may call to get in contact with example: "2281"
         headerSubject:
the sender.         type: string
example: "46701234567"         contactInformationEmaildescription: The subject of the digital mail.
    type: string     example: Viktig information från   description: Email address the recipient may use to get in contact with
Sundsvalls kommun
        supportInfo:
           the sender.$ref: '#/components/schemas/SupportInfo'
        attachments:
  example: someone@sundsvall.se       descriptiontype: Containsarray
contact information and where the recipient may turn to  items:
      for questions.     Problem$ref: '#/components/schemas/Attachment'
        typebodyInformation:
   object       properties$ref: '#/components/schemas/BodyInformation'
    SupportInfo:
  instance:    required:
      type:- stringcontactInformationEmail
      - contactInformationPhoneNumber
  format: uri   - contactInformationUrl
    type:  -  supportText
      type: stringobject
      properties:
   format: uri    supportText:
     parameters:     type: string
    type: object     description: Information text describing the different additionalProperties:ways the recipient
          type: object may contact the sender.
    title:      example: Kontakta oss via epost type:eller stringtelefon.
        detailcontactInformationUrl:
          type: string
          statusdescription: Url where the recipient may find more information.
  $ref: '#/components/schemas/StatusType'     StatusType:  example: https://sundsvall.se/
   type: object     contactInformationPhoneNumber:
 properties:         reasonPhrasetype: string
         type description: stringPhone number the recipient may call to get  statusCode:in contact with
            type:the integersender.
          formatexample: int32"4660191000"
    DigitalMailResponse:    contactInformationEmail:
  type: object       propertiestype: string
       distributionId:   description: Email address the recipient may use to type:get stringin contact with
  Attachment:       required:   the sender.
  - body       - contentTypeexample: sundsvalls.kommun@sundsvall.se
      -description: filenameContains contact information and where the recipient type:may objectturn to
     properties:   for questions.
    contentTypeProblem:
      type: object
  type:  string  properties:
        descriptioninstance:
content type         bodytype: string
          typeformat: stringuri
          descriptiontype:
Base64-encoded body         filenametype: string
         type format: stringuri
        parameters:
   description: The name of the file  type: object
   description: "An attachment, e.g. pdf, docx etc." additionalProperties:
   SecureDigitalMailRequest:       required:  type: object
   - bodyInformation    status:
  - headerSubject       - municipalityId$ref: '#/components/schemas/StatusType'
      - supportInfo title:
     type: object       properties:type: string
        municipalityIddetail:
          type: string
    StatusType:
      descriptiontype: MunicipalityIdobject
          exampleproperties:
SK         headerSubjectreasonPhrase:
          type: string
        statusCode:
 description:  The subject of the digital mail.  type: integer
       example: Viktig information frånformat: Sundsvallsint32
kommun    DeliveryStatus:
    supportInfo:  type: object
       $refproperties:
'#/components/schemas/SupportInfo'         attachmentsdelivered:
          type: arrayboolean
          itemspartyId:
            $reftype: '#/components/schemas/Attachment'string
        bodyInformationtransactionId:
          $reftype: '#/components/schemas/BodyInformation'string
    SecureDigitalMailResponseDigitalMailResponse:
      type: object
      properties:
        distributionIddeliveryStatus:
          type$ref: string'#/components/schemas/DeliveryStatus'
  securitySchemes: {}

Säkerhetsklassning

Säkerhetsklass <0, 1, 2, 3, 4>

Autentiseringsmetod: Oauth2

(Ref: Säkerhetsklassning av APIer )

API-ägare

TBD

Teknisk ägare

API-Teamet

För tekniska frågor:
teamdynasty@sundsvall.se

Länkar

  • Test

  • Sandbox

  • Produktion

FAQ

API-exempel