Versions Compared

Key

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

Beskrivning

Hämta bolagengagemang för en privatperson från Bolagsverket.

I steg två skall tjänsten byggas ut mot Bolagsverkets Mina Ombud.

I ett första steg anropar vi Bolagsverkets engagemang-tjänst för att hämta vilka bolagsengagemang en privatperson har.

Då alla anrop mot bolagsverket innebär en kostnad, cachas alla lyckade svar från bolagsverket i 30 minuter.

Livscykelstatus

Design

Lösningsbeskrivning

Gliffy
imageAttachmentIdatt810057752
macroId8e68bf78-b11f-46cc-829c-91df332effc8
baseUrlhttps://sundsvall.atlassian.net/wiki
nameBusinessEngagements
diagramAttachmentIdatt810778625
containerId793640981
timestamp1640605330419

Hantering av personuppgifter

API specifikation

Swagger ui
urlhttps://api-test.sundsvall.se/businessengagements/sandbox/1.0/api-docs
openapi: 3.0.1
info:
  title: Businessapi-businessengagements
Engagements API   contact: {}
  license:
    name: MIT License
    url: https://opensource.org/licenses/MIT
  version: "1.0"
servers:
- url: https://api-test.sundsvall.se/businessengagements/sandbox/1.0/
tags:
- name: Business Engagements
  description: En tjänst som hämtar en persons företagsengagemang
paths:
  /engagements/{partyId}:
    get:
      tags:
      - Business Engagements
      operationId: getEngagements
      parameters:
      - name: partyId
        in: path
        required: true
        schema:
          type: string
          description: Unique identifier for a person
          example: 6a5c3d04-412d-11ec-973a-0242ac130003
      - name: personalName
        in: query
        required: true
        schema:
          type: string
          description: The first and surname of the person
      - name: serviceName
        in: query
        required: true
        schema:
          type: string
          description: Name of the system initiating the request
          example: Mina Sidor
      responses:
        "500200":
          description: InternalSuccessful Server ErrorOperation
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ProblemBusinessEngagementsResponse'
        "200204":
          description: SuccessfulNo OperationContent
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/BusinessEngagementsResponse'
        "204404":
          description: NoNot ContentFound
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/BusinessEngagementsResponseProblem'
        "400":
          description: Bad Request
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Problem'
        "404500":
          description: NotInternal Server FoundError
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Problem'
components:   schemas/api-docs:
    Problemget:
      typetags:
object      - properties:API
        instancesummary: OpenAPI
         typeoperationId: stringgetApiDocs
          formatresponses:
uri         type"200":
          typedescription: stringOK
          formatcontent:
uri         parameters:   application/yaml:
       type: object       schema:
   additionalProperties:             type: objectstring
        statusx-auth-type: None
      x-throttling-tier: Unlimited
 $ref: '#/components/schemas/StatusType'    x-wso2-mutual-ssl: Optional
components:
  titleschemas:
    BusinessEngagementsResponse:
     type required:
 string     - status
  detail:    type: object
      typeproperties:
string      StatusType  engagements:
      type:  object  type: array
   properties:       items:
 reasonPhrase:           type$ref: string'#/components/schemas/Engagement'
        statusCodestatusDescriptions:
          type: integerobject
          formatadditionalProperties:
int32     BusinessEngagementsResponse:       requiredtype:  string
    - status       typedescription: object"In case fetching one or more engagement properties:failed, this will\
      engagements:        \ show why type:it arrayfailed. There may be more than one description if several\
 items:             $ref: '#/components/schemas/Engagement'
\ engagements failed."
       statusDescriptions:     example: Timeout
    type: object           additionalProperties:
            type: string
            description: "description: "In case fetching one or more engagement failed, this will\
 
            \ show why it failed. There may be more than one description if several\
 
            \ engagements failed."
            example: Timeout
        status:
 description: "In case fetching one or more engagement failed, this will\
         type: string
          description: If fetching all engagements went "OK" or "NOK". A "NOK" may
            still return engagements but indicates that the information is incomplete.
          example: OK
          enum:
          - OK
          - NOK
    Engagement:
      type: object
      properties:
        organizationName:
          type: string
          description: Name of the organization
          example: Styrbjörns båtar
        organizationNumber:
          type: string
          description: "Organization number, may also be personal number in case of\
       \ show why it failed. There\ mayenskild befirma"
more than one description if several\     example: "2021005448"
      \ engagements failed."organizationId:
          exampletype: string
 Timeout         statusdescription: Unique id for the organization (UUID)
      type: string   example: bab17d8b-af38-4531-967c-083f15ca1571
      description: Represents Ifa fetchingpersons allbusiness engagementsengagement.
went "OK" or "NOK". A "NOK" may Problem:
      type: object
      stillproperties:
return engagements but indicates that the information is incomplete.instance:
          exampletype: OKstring
          enumformat: uri
        type:
- OK         type: string
- NOK     Engagement:    format: uri
 type: object       propertiesparameters:
        organizationName:  type:  object
      type: string   additionalProperties:
       description: Name of the organization type: object
        examplestatus:
Styrbjörns båtar         organizationNumber$ref: '#/components/schemas/StatusType'
         typetitle:
string           descriptiontype: "Organizationstring
number, may also be personal number in case of\detail:
          type:  \string
enskild firma"    StatusType:
      exampletype: "2021005448"object
        organizationIdproperties:
        statusCode:
 type: string         type: integer
description: "Unique id for the organization (UUID), NOT implemented yet!" format: int32
        examplereasonPhrase: "2021005448"
      description: Represents a persons businesstype: engagement.string
  securitySchemes: {}

Alla anrop mot bolagsverket har två tvingande parametrar vilket även är tvingande in i detta API förutom partyId:

  1. serviceName - Det system som anropet initierades ifrån.

  2. personalName - Namnet på den person som företagen skall hämtas för.

Hämta företagsengagemang (/engagements)

Request: /engagements/6a5c3d04-412d-11ec-973a-0242ac130003?personalName=Jane%20Doe&serviceName=Kommunen

Code Block
languagejson
{
	"partyId": "6a5c3d04-412d-11ec-973a-0242ac130003",
	"personalName": "Jane Doe",
	"serviceName": "Kommunen"
}

Response:

Code Block
languagejson
{
    "engagements": [
        {
            "organizationName": "Fritjofs blommor och blad",
            "organizationNumber": "5561234567",
            "organizationId": " 793afd03-3be5-4e14-863f-a61d4859841d"
        },
        {
            "organizationName": "Vanja Jumpers plåt",
            "organizationNumber": "5561234568"
        }
    ]
    "statusDescriptions": {
      "5561234568": "Couldn't fetch guid for organization number"
    },
    "status": "NOK"
}

Förtydligande response-parametrar:

  • engagements: Kan innehålla 0 → n antal engagemang personen har, varje objekt innehåller organisationsnamn och organisationsnummer.

    • organizationId: unikt uuid/guid för organisationsnumret, om det inte återfinns i LegalEntity utelämnas denna helt.

  • statusDescriptions: Innehåller eventuella fel i samband med hämtandet av bolagsengagemang eller organizationId. T.ex. att underliggande system (från bolagsverket) överskred begärd svarstid eller att det inte gick att hämta organizationId. Typen är en “Map<String, String>”.

  • status: Visar om personens alla engagemang kunde hämtas utan fel. Vid eventuella fel sätts denna till “NOK” och det reflekteras även i parametern statusDescriptions genom att varje felbeskrivning läggs till.

Testdata

Bolagsverket har lagt upp fiktiva personnummer med olika bolagsengagemang, partyId för dessa personer finns upplagda i testmiljön för CitizenMapping och mappar till följande dokument.

Personnummer

partyId

198104112381

65694a6d-5f5d-4bb6-b256-3b81cb419b60

198101032384

d1eda732-5aec-45e2-a673-4debd42b2f04

198101052382

d4554399-91bb-4258-a7a7-afb9f265dd66

198101012386

740c013c-f979-4ad3-a073-42a6d5255e3a

198101042383

5a4afbf9-8897-42a8-aaf0-de9530849f7c

193403223328

af99121e-4dfc-477c-8b02-daf70603b55f

198104152387

ea4a0b53-fa9a-42a6-89a6-7ab1431a014f

Säkerhetsklassning

Säkerhetsklass 1

Autentiseringsmetod: Oauth2

(Ref: Säkerhetsklassning av APIer )

API-ägare

<Kontaktuppgifter till den verksamhet som äger APIets livscykel>

Teknisk ägare

API-teamet

Ansvarigt team: Team Dynasty

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

Länkar