Versions Compared
Version | Old Version 48 | New Version 49 |
---|---|---|
Changes made by | ||
Saved on |
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Beskrivning
Hämta Hämtar bolagengagemang för en privatperson från Bolagsverket samt bolagsinformation för ett specifikt bolag.
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 Alla lyckade svar från bolagsverket cachas i 30 minuter.
Livscykelstatus
DesignI produktion
Lösningsbeskrivning
Gliffy | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Hantering av personuppgifter
API specifikation
Expand | ||
---|---|---|
| ||
eyJ4NXQiOiJPV1l4TkRJd016ZGhPREk1WVdRNU1EZGxPREkzT1RZeU1qTXpZemN4TW1NMU0yRTFaREF5WXpGa01qQmpNV0ZrTkROa1pXVTFPRFk1T1dJMlpHRTBZZyIsImtpZCI6ImdhdGV3YXlfY2VydGlmaWNhdGVfYWxpYXMiLCJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJQRVJTT05BTFwvV1NPMl9NU19zaWduYXRvcnlAY2FyYm9uLnN1cGVyIiwiYXBwbGljYXRpb24iOnsib3duZXIiOiJQRVJTT05BTFwvV1NPMl9NU19zaWduYXRvcnkiLCJ0aWVyUXVvdGFUeXBlIjpudWxsLCJ0aWVyIjoiVW5saW1pdGVkIiwibmFtZSI6IkRlZmF1bHRBcHBsaWNhdGlvbiIsImlkIjoyNSwidXVpZCI6ImYwZDU4MTc3LWVlNzctNDNjOC1iNDM0LTBmNDQyOTBkMWU5ZiJ9LCJpc3MiOiJodHRwczpcL1wvYXBpLWltLXRlc3Quc3VuZHN2YWxsLnNlOjQ0M1wvb2F1dGgyXC90b2tlbiIsInRpZXJJbmZvIjp7IkJyb256ZSI6eyJ0aWVyUXVvdGFUeXBlIjoicmVxdWVzdENv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I6IlBFUlNPTkFMXC9qb2UxNGxpbiIsInZlcnNpb24iOiIxLjAiLCJzdWJzY3JpcHRpb25UaWVyIjoiVW5saW1pdGVkIn1dLCJwZXJtaXR0ZWRJUCI6IiIsImlhdCI6MTY2MDcyMDE3NiwianRpIjoiM2Q3ZDYxZTgtMzY3YS00YTgwLWJjNDItM2M5N2Y5MjQzNjVkIn0=.rOzKm1CCSVC8PYy5Rb1hOOkDWtNgxMOrBnXUPo1g1u2k8yAoAzPHjskzbXgUdllXFNiJSnDTYg4imGnUv_4o6OF4yoCALLD31OxbmSkosYLnZ-hnVZToZ42mnouIuwsmaTTnuEZSa3GB3eL3K9k5NnjZu-hw_jvAN10cekvYp5JLMDUNI6STPMEtMCXo_jiB-UYbisgUh-2JWSBGgciE_wnakaMFUZKpamHpdHw93B415RzXR5dUJTebVKvafo8oASgO5MElYdBVBretrdmZXipaLYL5b7xObmqokx1MmqhFA_7iyvuLH9csjdYQTrZjG1vmj5LV4pGUDTXofYaC-A== |
Swagger ui |
---|
openapi: 3.0.1 info: title: api-businessengagements contact: {} license: name: MIT License url: https://opensource.org/licenses/MIT version: "1.01" servers: - url: https://api-test.sundsvall.se/businessengagements/1.01/ tags: - name: Business Engagements description: En tjänst som hämtar en persons företagsengagemang och dess information paths: /engagementsinformation/{partyId}: get: tags: - Business Engagements operationId: getEngagementsgetBusinessInformation parameters: - name: partyId in: path requireddescription: trueUnique identifier for an organization number schema: required: true type: string schema: type: string description: Unique identifier for aan organization personnumber example: 6a5c3d04-412d-11ec-973a-0242ac130003fb2f0290-3820-11ed-a261-0242ac120002 example: fb2f0290-3820-11ed-a261-0242ac120002 - name: personalNameorganizationName in: query description: Name of the organization required: true schema: type: string description: The first and surnameName of the personorganization - nameresponses: serviceName "204": in: query requireddescription: trueNo Content schema: content: type: string '*/*': description: Name of the system initiating the request schema: example: Mina Sidor $ref: responses:'#/components/schemas/BusinessInformation' "200400": description: SuccessfulBad OperationRequest content: '*/*': schema: $ref: '#/components/schemas/BusinessEngagementsResponseProblem' "204404": description: NoNot ContentFound content: '*/*': schema: $ref: '#/components/schemas/BusinessEngagementsResponseProblem' "404200": description: NotSuccessful FoundOperation content: '*/*': schema: $ref: '#/components/schemas/ProblemBusinessInformation' "400500": description: BadInternal Server RequestError content: '*/*': schema: $ref: '#/components/schemas/Problem' /engagements/{partyId}: get: "500": tags: description: Internal Server- ErrorBusiness Engagements operationId: getEngagements content: parameters: - '*/*'name: partyId in: path schema: description: Unique identifier for a person $ref required: '#/components/schemas/Problem'true /api-docs: getschema: tags: type: string - API summarydescription: OpenAPIUnique identifier for a person operationId: getApiDocs responsesexample: 6a5c3d04-412d-11ec-973a-0242ac130003 "200" example: 6a5c3d04-412d-11ec-973a-0242ac130003 - descriptionname: OKpersonalName contentin: query description: The application/yaml: first and surname of the person required: true schema: schema: type: string x-auth-type: None description: The first x-throttling-tier: Unlimited and surname of the person x-wso2-mutual-ssl: Optional security: - ApiKeyAuthname: []serviceName components: schemas: BusinessEngagementsResponsein: query required: description: Name of the -system statusinitiating the request type: object required: true properties: engagementsschema: type: arraystring itemsdescription: Name of the system initiating the request $ref: '#/components/schemas/Engagement' example: Mina Sidor statusDescriptions: example: Mina Sidor type: object responses: additionalProperties"200": description: Successful type:Operation string content: description: "In case fetching one or more engagement failed, this will\ '*/*': \schema: show why it failed. There may be more than one description if several\ $ref: '#/components/schemas/BusinessEngagementsResponse' \ engagements failed.""204": description: No example: TimeoutContent descriptioncontent: "In case fetching one or more engagement failed, this will\ '*/*': \ show why it failed. There may be more than one description if several\ schema: $ref: '#/components/schemas/BusinessEngagementsResponse' \ engagements failed."400": exampledescription: TimeoutBad Request statuscontent: type'*/*': string descriptionschema: If fetching all engagements went "OK" or "NOK". A "NOK" may $ref: '#/components/schemas/Problem' still return engagements but"404": indicates that the information is incomplete. description: Not Found example: OK content: enum: '*/*': - OK -schema: NOK Engagement: type: object $ref: '#/components/schemas/Problem' properties: organizationName"500": typedescription: stringInternal Server Error description: Name ofcontent: the organization example'*/*': Styrbjörns båtar organizationNumber: schema: type: string description$ref: "Organization number, may also be personal number in case of\'#/components/schemas/Problem' /api-docs: get: tags: \- enskildAPI firma" summary: OpenAPI example: "2021005448" operationId: getApiDocs organizationIdresponses: type"200": string description: UniqueOK id for the organization (UUID) content: example: bab17d8b-af38-4531-967c-083f15ca1571 descriptionapplication/yaml: Represents a persons business engagement. Problem: typeschema: object properties: instancetype: string x-auth-type: stringNone x-throttling-tier: Unlimited format: uri x-wso2-mutual-ssl: Optional components: typeschemas: Problem: type: stringobject formatproperties: uri parametersinstance: type: objectstring additionalPropertiesformat: uri type: object statustype: string $ref format: '#/components/schemas/StatusType'uri titleparameters: type: stringobject detailadditionalProperties: type: stringobject StatusType: title: type: object propertiestype: string statusCode detail: type: integerstring status: format: int32 reasonPhrase:$ref: '#/components/schemas/StatusType' StatusType: type: stringobject securitySchemesproperties: ApiKeyAuth reasonPhrase: type: apiKeystring instatusCode: header nametype: apikey |
Alla anrop mot bolagsverket har två tvingande parametrar vilket även är tvingande in i detta API förutom partyId:
serviceName
- Det system som anropet initierades ifrån.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 | ||
---|---|---|
| ||
{
"partyId": "6a5c3d04-412d-11ec-973a-0242ac130003",
"personalName": "Jane Doe",
"serviceName": "Kommunen"
} |
Response:
Code Block | ||
---|---|---|
| ||
{ "engagements": [ integer format: int32 Address: type: object properties: city: { type: string "organizationName": "Fritjofs blommor och blad",description: City "organizationNumber"example: "5561234567",Sundsvall street: "organizationId": " 793afd03-3be5-4e14-863f-a61d4859841d" type: string }, description: {Street address "organizationName"example: "VanjaStorgatan Jumpers10 plåt", postcode: "organizationNumber": "5561234568" type: string } description: Postal code ] example: "statusDescriptions": {85740" careOf: "5561234568": "Couldn't fetch guid for organization number"type: string description: Care of }, "status"example: "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>”.
John Doe
description: Address model
BusinessInformation:
type: object
properties:
legalForm:
$ref: '#/components/schemas/LegalForm'
address:
$ref: '#/components/schemas/Address'
emailAddress:
type: string
description: The companys contact email
example: somecompany@noreply.com
phoneNumber:
type: string
description: The companys contact phone number
example: 070-1234567
municipality:
$ref: '#/components/schemas/Municipality'
county:
$ref: '#/components/schemas/County'
fiscalYear:
$ref: '#/components/schemas/FiscalYear'
companyForm:
$ref: '#/components/schemas/CompanyForm'
companyRegistrationTime:
type: string
description: When the company was registered
format: date
example: 2022-01-01
liquidationInformation:
$ref: '#/components/schemas/LiquidationInformation'
deregistrationDate:
type: string
description: When and if the company was deregistered
format: date
example: 2022-09-01
companyLocation:
$ref: '#/components/schemas/Address'
businessSignatory:
type: string
description: Who may sign for the company
example: Firman tecknas av styrelsen
companyDescription:
type: string
description: Information regarding the companys operations
example: Psykologisk forskning på bin samt därmed förenlig verksamhet.
sharesInformation:
$ref: '#/components/schemas/SharesInformation'
errorInformation:
$ref: '#/components/schemas/ErrorInformation'
description: Business information model
CompanyForm:
type: object
properties:
companyFormCode:
type: string
description: Company form
example: AB
companyFormDescription:
type: string
description: Company form description
example: Aktiebolag
description: Company form information model
County:
type: object
properties:
countyName:
type: string
description: County
example: Västernorrland
countyCode:
type: string
description: County code
example: "22"
description: County information model
ErrorInformation:
type: object
properties:
hasErrors:
type: boolean
description: Indicates if there was an error while fetching data and that
one or more parameters could not be fetched
example: true
errorDescriptions:
type: object
additionalProperties:
type: string
description: Map with error code (from bolagsverket) as key and the error
description as value
example: "9071006, Ej behörig - ej firmatecknare."
description: Map with error code (from bolagsverket) as key and the error
description as value
example: "9071006, Ej behörig - ej firmatecknare."
description: Error information model
FiscalYear:
type: object
properties:
fromDay:
type: integer
description: Fiscal year start day
format: int32
example: 1
fromMonth:
type: integer
description: Fiscal year start month
format: int32
example: 1
toDay:
type: integer
description: Fiscal year end day
format: int32
example: 31
toMonth:
type: integer
description: Fiscal year end month
format: int32
example: 12
description: Fiscal year information model
LegalForm:
type: object
properties:
legalFormDescription:
type: string
description: Legal form
example: Övriga aktiebolag
legalFormCode:
type: string
description: Legal form code
example: "49"
description: Legal form information model
LiquidationInformation:
type: object
properties:
liquidationReasons:
type: array
items:
$ref: '#/components/schemas/LiquidationReason'
cancelledLiquidation:
$ref: '#/components/schemas/LiquidationReason'
description: Liquidation information model
LiquidationReason:
type: object
properties:
liquidationCode:
type: string
description: Liquidation code
example: "21"
liquidationDescription:
type: string
description: Liquidation description
example: Konkurs avslutad
liquidationDate:
type: string
description: Liquidation date
format: date
example: 2022-09-01
liquidationType:
type: string
description: Type of liquidation
example: Konkurs
description: Reason for liquidation or cancellation of liquidation
Municipality:
type: object
properties:
municipalityName:
type: string
description: Municipality
example: Sundsvalls Kommun
municipalityCode:
type: string
description: Municipality code
example: "2281"
description: Municipality information model
ShareType:
type: object
properties:
label:
type: string
description: Label of the shares
example: B
numberOfShares:
type: integer
description: Number of shares of this class
example: 25000
voteValue:
type: string
description: The vote value for one share
example: 1/10
description: Share information model
SharesInformation:
type: object
properties:
shareTypes:
type: array
items:
$ref: '#/components/schemas/ShareType'
numberOfShares:
type: integer
description: Number of total shares
example: 100000
shareCapital:
type: number
description: Shares value
example: 120000.0
shareCurrency:
type: string
description: Shares value currency
example: sek
description: Shares information model
BusinessEngagementsResponse:
required:
- status
type: object
properties:
engagements:
type: array
items:
$ref: '#/components/schemas/Engagement'
statusDescriptions:
type: object
additionalProperties:
type: string
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
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:
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\
\ enskild firma"
example: "2021005448"
organizationId:
type: string
description: Unique id for the organization (UUID)
example: bab17d8b-af38-4531-967c-083f15ca1571
description: Represents a persons business engagement.
securitySchemes: {}
|
Alla anrop mot bolagsverket har två tvingande parametrar vilket även är tvingande in i detta API förutom partyId:
serviceName
- Det system som anropet initierades ifrån.personalName
- Namnet på den person som företagen skall hämtas för.
Hämta företagsengagemang (/engagements/{partyId})
Request: /engagements/6a5c3d04-412d-11ec-973a-0242ac130003?personalName=Jane%20Doe&serviceName=Kommunen
Code Block | ||
---|---|---|
| ||
{
"partyId": "6a5c3d04-412d-11ec-973a-0242ac130003",
"personalName": "Jane Doe",
"serviceName": "Kommunen"
} |
Response:
Code Block | ||
---|---|---|
| ||
{
"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.
Hämta företagsinformation (/information/{partyId})
Request: /information/6a5c3d04-412d-11ec-973a-0242ac130003?organizationName=Testbusiness
Response:
Code Block | ||
---|---|---|
| ||
{
"legalForm": {
"legalFormDescription": "Övriga aktiebolag",
"legalFormCode": "49"
},
"address": {
"city": "STOCKHOLM",
"street": "Mäster Samuelsgatan 42",
"postcode": "11157",
"careOf": ""
},
"emailAddress": "somewhere@nowhere.com",
"phoneNumber": "070-990463",
"municipality": {
"municipalityName": "Stockholm kommun",
"municipalityCode": "0180"
},
"county": {
"countyName": "Stockholms län",
"countyCode": "01"
},
"fiscalYear": {
"fromDay": 1,
"fromMonth": 1,
"toDay": 31,
"toMonth": 12
},
"companyForm": {
"companyFormCode": "AB",
"companyFormDescription": "aktiebolag"
},
"companyRegistrationTime": "1993-01-07",
"liquidationInformation": {
"liquidationReasons": [
{
"liquidationCode": "21",
"liquidationDescription": "Konkurs avslutad",
"liquidationDate": "2013-10-24",
"liquidationType": "Konkurs"
},
{
"liquidationCode": "32",
"liquidationDescription": "Likvidation beslutad",
"liquidationDate": "2013-09-03",
"liquidationType": "Likvidation"
}
],
"cancelledLiquidation": {
"liquidationCode": "21",
"liquidationDescription": "Konkurs avslutad",
"liquidationDate": "2013-10-24",
"liquidationType": "Konkurs"
}
},
"deregistrationDate": "2013-10-24",
"companyLocation": {
"address": {
"city": "STOCKHOLM",
"street": "MÄSTER SAMUELSGATAN",
"postcode": "11157"
}
},
"businessSignatory": "Firman tecknas av styrelsen",
"companyDescription": "Psykologisk forskning på bin samt därmed förenlig verksamhet.",
"errorInformation": {
"hasErrors": true,
"errorDescriptions": {
"9071006": "Ej behörig - ej firmatecknare."
}
}
} |
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
Ansvarigt team: Team Dynasty
För tekniska frågor: mailto:teamdynasty@sundsvall.se