Versions Compared

Key

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

Beskrivning

Generell tjänst för att hantera medborgares och organisationers inställningar för hur återkoppling ska ske (för till exempel felanmälningar och driftstörningar).

Livscykelstatus

Under utveckling

Lösningsbeskrivning

Gliffy
imageAttachmentIdatt29949965
macroIde0cdd404-6147-48c0-b661-3cb73c11a997
baseUrlhttps://sundsvall.atlassian.net/wiki
namefeedbackSettingsAPI
diagramAttachmentIdatt29393082
containerId29065265
timestamp1643707761929

Hantering av personuppgifter

PersonId används för att knyta återkopplingsuppgifterna till en specifik individ. PersonId är obligatoriskt. I fall personen företräder en organisation så används personId i kombination med organisationsId för att knyta de återkopplingsuppgifter som gäller när personen företräder organisationen. Dvs, en person kan ha en specifik uppsättning återkopplingsuppgifter för personligt bruk samtidigt som hen har en annan uppsättning för respektive organisation som hen företräder. En organisation kan ha en eller flera företrädande personer.

En person eller företrädare för en organisation kan ha 0-n poster i listan över kontaktmetoder, men kan ej ha flera poster med samma innehåll. Dvs, hen kan tex bara ha en post med kontaktkanal SMS och destination 0701234567. Hen kan däremot ha flera poster för tex SMS, så länge destinationen skiljer sig åt mellan dem. Exempelvis:

Code Block
languagejson
{
	"id": "15aee472-46ab-4f03-9605-68bd64ebc84b",
	"personId": "49a974ea-9137-419b-bcb9-ad74c81a1d1a",
	"channels": [
		{
			"contactMethod": "SMS",
			"destination": "0701112233",
			"sendFeedback": true
		},
		{
			"contactMethod": "SMS",
			"destination": "0702223344",
			"sendFeedback": true
		},
		{
			"contactMethod": "EMAIL",
			"destination": "test.testorsson@test.se",
			"sendFeedback": true
		}
	],
	"filters": [],
	"created": "2022-01-11T16:12:33.004+01:00",
	"modified": "2022-01-20T10:30:09.469+01:00"
}

API specifikation

Expand
titleAPI-nyckel för sandbox-miljö. Klicka på "Authorize" nedan och ange denna nyckel för att testa API:et.

eyJ4NXQiOiJOVGRtWmpNNFpEazNOalkwWXpjNU1tWm1PRGd3TVRFM01XWXdOREU1TVdSbFpEZzROemM0W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F-j6Cz-K9oREU8nHEBzup0eOYRBHC-f_ffit1PCLFpxQYr3KpX5j-zlmWg4zdwO3rFQev27tvgkIVzq0yHYlmQ5QAxu7fRP0ymIE42J30smRdEPd2_ZyME9wTOBJDJFQc1oBsoX6BCNFxXWeVlRuTk_UWJ5h0JAEwGxwn9KPsyp6UOj3tpBTpBXnTOCDDL42ZI5gwO_ATq6iRHihymyv_fgLLgn-LwLHaV_a4X9ZOBhnk4vlduwyC6_hG27wQA37NVTDfqpJDWQEab6XRBV7VOiI5ayNy6MT2zALQ9-Wbd2vaG8EP-xYnUzhGo4PnS3Y5SAVLD5Iz1cA==

Swagger ui
---
openapi: 3.0.2
info:
  title: api-feedbacksettings-dev API
  version: "1.1"
servers:
  - url: https://api-test.sundsvall.se/feedbacksettings/1.1
paths:
  /api-docs:
    get:
      tags:
      - API
      summary: OpenAPI-definition
      parameters: []
      responses:
        "200":
          description: ok
      x-auth-type: None
  /settings:
    get:
      tags:
      - Feedback Settings Resource
      description: |
        Resource for querying for feedback settings matching sent in person- and/or organizationId. Returned feedback settings contains a matching percent,
        which is 100% if request is not extended with filters (i.e. without filters, all returned posts matches incoming parameters to 100%).<br><br>

        If needed, the client can extend the request to include filters. When filters are present they will be taken into account and matched against the
        filters on the returned feedback settings when calculating matching percent. All posts matching sent in person- and/or organizationId will still be
        returned, but with a calculated matching percent that is based on how filters for the feedback settings posts matches sent in filters.<br><br>

        Filters are sent as header values. The convention of the header name is <code>x-filter-[filterkey]</code>. It is possible to include multiple values
        for a filter by sending multiple headers with same filter name and different values for each entry, see example below.<br><br>

        <pre>
        -H 'x-filter-categories: broadband'
        -H 'x-filter-categories: electricity'</pre>
      parameters:
      - name: limit
        in: query
        schema:
          format: int32
          default: 20
          maximum: 100
          minimum: 1
          type: integer
      - name: organizationId
        in: query
        schema:
          type: string
      - name: page
        in: query
        schema:
          format: int32
          default: 1
          minimum: 1
          type: integer
      - name: personId
        in: query
        schema:
          type: string
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchResult'
        "400":
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceErrorResponse'
        "500":
          description: Internal Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceErrorResponse'
    post:
      tags:
      - Feedback Settings Resource
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateFeedbackSettingRequest'
      responses:
        "201":
          description: Created
          headers:
            Location:
              style: simple
              schema:
                type: string
          content: {}
        "400":
          description: Bad request
          content: {}
        "500":
          description: Internal Server error
          content: {}
  /settings/{id}:
    get:
      tags:
      - Feedback Settings Resource
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FeedbackSetting'
        "400":
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceErrorResponse'
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceErrorResponse'
        "500":
          description: Internal Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceErrorResponse'
    delete:
      tags:
      - Feedback Settings Resource
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
      responses:
        "204":
          description: Successful operation
        "400":
          description: Bad request
          content: {}
        "404":
          description: Not found
          content: {}
        "500":
          description: Internal Server error
          content: {}
    patch:
      tags:
      - Feedback Settings Resource
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateFeedbackSettingRequest'
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FeedbackSetting'
        "400":
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceErrorResponse'
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceErrorResponse'
        "500":
          description: Internal Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceErrorResponse'
security:
  - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth: 
      type: apiKey
      in: header   
      name: apikey
  schemas:
    ContactMethod:
      enum:
      - EMAIL
      - SMS
      type: string
    CreateFeedbackSettingRequest:
      description: Request model for creating a new feedback setting
      required:
      - personId
      type: object
      properties:
        personId:
          description: Unique id for the person to whom the feedback setting shall
            apply
          type: string
          example: 15aee472-46ab-4f03-9605-68bd64ebc73f
          nullable: false
        organizationId:
          description: Unique id for the company to which the feedback setting shall
            apply if the setting refers to an organizational representative
          type: string
          example: 15aee472-46ab-4f03-9605-68bd64ebc84a
        filters:
          type: array
          items:
            $ref: '#/components/schemas/RequestedFeedbackFilter'
        channels:
          type: array
          items:
            $ref: '#/components/schemas/RequestedFeedbackChannel'
    FeedbackChannel:
      description: Feedback channel model
      type: object
      properties:
        contactMethod:
          allOf:
          - $ref: '#/components/schemas/ContactMethod'
          - description: Method of contact
            readOnly: true
            example: SMS
        destination:
          description: Point of destination
          type: string
          readOnly: true
        sendFeedback:
          description: 'Signal if channel should be used or not when sending feedback '
          type: boolean
          readOnly: true
          example: true
    FeedbackFilter:
      description: Feedback filter model
      type: object
      properties:
        key:
          description: Unique key for the filter
          type: string
          example: categories
        values:
          description: List of values for the filter
          uniqueItems: true
          type: array
          items:
            type: string
          example:
          - broadband
          - electricity
    FeedbackSetting:
      description: Feedback setting model
      type: object
      properties:
        id:
          description: Unique id for the feedback setting
          type: string
          readOnly: true
          example: 0d64c132-3aea-11ec-8d3d-0242ac130003
        personId:
          description: Unique id for the person to whom the feedback setting applies
          type: string
          readOnly: true
          example: 15aee472-46ab-4f03-9605-68bd64ebc73f
        organizationId:
          description: Unique id for the company to which the feedback setting applies
            in cases where the setting refers to an organizational representative
          type: string
          readOnly: true
          example: 15aee472-46ab-4f03-9605-68bd64ebc84a
        filters:
          type: array
          items:
            description: Feedback filter model
            type: object
            properties:
              key:
                description: Unique key for the filter
                type: string
                example: categories
              values:
                description: List of values for the filter
                uniqueItems: true
                type: array
                items:
                  type: string
                example:
                - broadband
                - electricity
          readOnly: true
        channels:
          type: array
          items:
            description: Feedback channel model
            type: object
            properties:
              contactMethod:
                allOf:
                - $ref: '#/components/schemas/ContactMethod'
                - description: Method of contact
                  readOnly: true
                  example: SMS
              destination:
                description: Point of destination
                type: string
                readOnly: true
              sendFeedback:
                description: 'Signal if channel should be used or not when sending
                  feedback '
                type: boolean
                readOnly: true
                example: true
          readOnly: true
        created:
          format: date-time
          description: Timestamp for creation
          type: string
          readOnly: true
          example: 2022-01-20T10:30:09.469+01:00
        modified:
          format: date-time
          description: Timestamp for last modification
          type: string
          readOnly: true
          example: 2022-01-20T10:30:09.469+01:00
    MetaData:
      description: Metadata model
      type: object
      properties:
        page:
          format: int32
          description: Current page
          type: integer
          readOnly: true
          example: 5
        limit:
          format: int32
          description: Displayed objects per page
          type: integer
          readOnly: true
          example: 20
        count:
          format: int32
          description: Displayed objects on current page
          type: integer
          readOnly: true
          example: 13
        totalRecords:
          format: int64
          description: Total amount of hits based on provided search parameters
          type: integer
          readOnly: true
          example: 98
        totalPages:
          format: int32
          description: Total amount of pages based on provided search parameters
          type: integer
          readOnly: true
          example: 23
    RequestedFeedbackChannel:
      description: Requested feedback channel model
      required:
      - contactMethod
      - destination
      - sendFeedback
      type: object
      properties:
        contactMethod:
          allOf:
          - $ref: '#/components/schemas/ContactMethod'
          - description: Method of contact
            example: SMS
            nullable: false
        destination:
          description: Point of destination
          type: string
          example: "0701234567"
        sendFeedback:
          description: 'Signal if channel should be used or not when sending feedback '
          type: boolean
          example: true
          nullable: false
    RequestedFeedbackFilter:
      description: Requested feedback filter model
      required:
      - key
      - values
      type: object
      properties:
        key:
          description: Unique key for the filter
          pattern: \S
          type: string
          example: categories
          nullable: false
        values:
          description: List of values for the filter
          minItems: 1
          uniqueItems: true
          type: array
          items:
            type: string
          example:
          - broadband
          - electricity
    SearchResult:
      description: Search result model
      type: object
      properties:
        _meta:
          $ref: '#/components/schemas/MetaData'
        feedbackSettings:
          type: array
          items:
            description: Weighted feedback setting model
            type: object
            properties:
              id:
                description: Unique id for the feedback setting
                type: string
                readOnly: true
                example: 0d64c132-3aea-11ec-8d3d-0242ac130003
              personId:
                description: Unique id for the person to whom the feedback setting
                  applies
                type: string
                readOnly: true
                example: 15aee472-46ab-4f03-9605-68bd64ebc73f
              organizationId:
                description: Unique id for the company to which the feedback setting
                  applies in cases where the setting refers to an organizational representative
                type: string
                readOnly: true
                example: 15aee472-46ab-4f03-9605-68bd64ebc84a
              filters:
                type: array
                items:
                  description: Feedback filter model
                  type: object
                  properties:
                    key:
                      description: Unique key for the filter
                      type: string
                      example: categories
                    values:
                      description: List of values for the filter
                      uniqueItems: true
                      type: array
                      items:
                        type: string
                      example:
                      - broadband
                      - electricity
                readOnly: true
              channels:
                type: array
                items:
                  description: Feedback channel model
                  type: object
                  properties:
                    contactMethod:
                      allOf:
                      - $ref: '#/components/schemas/ContactMethod'
                      - description: Method of contact
                        readOnly: true
                        example: SMS
                    destination:
                      description: Point of destination
                      type: string
                      readOnly: true
                    sendFeedback:
                      description: 'Signal if channel should be used or not when sending
                        feedback '
                      type: boolean
                      readOnly: true
                      example: true
                readOnly: true
              created:
                format: date-time
                description: Timestamp for creation
                type: string
                readOnly: true
                example: 2022-01-20T10:30:09.469+01:00
              modified:
                format: date-time
                description: Timestamp for last modification
                type: string
                readOnly: true
                example: 2022-01-20T10:30:09.469+01:00
              matchingPercent:
                format: int32
                description: Percentual match compared to filters in request
                type: integer
                readOnly: true
                example: 37
          readOnly: true
    ServiceErrorResponse:
      type: object
      properties:
        httpCode:
          format: int32
          type: integer
        message:
          type: string
        technicalDetails:
          $ref: '#/components/schemas/TechnicalDetails'
    TechnicalDetails:
      type: object
      properties:
        rootCode:
          format: int32
          type: integer
        rootCause:
          type: string
        serviceId:
          type: string
        details:
          type: array
          items:
            type: string
    UpdateFeedbackSettingRequest:
      description: Request model for updating a feedback setting
      type: object
      properties:
        channels:
          type: array
          items:
            $ref: '#/components/schemas/RequestedFeedbackChannel'
        filters:
          type: array
          items:
            $ref: '#/components/schemas/RequestedFeedbackFilter'
    WeightedFeedbackSetting:
      description: Weighted feedback setting model
      type: object
      properties:
        id:
          description: Unique id for the feedback setting
          type: string
          readOnly: true
          example: 0d64c132-3aea-11ec-8d3d-0242ac130003
        personId:
          description: Unique id for the person to whom the feedback setting applies
          type: string
          readOnly: true
          example: 15aee472-46ab-4f03-9605-68bd64ebc73f
        organizationId:
          description: Unique id for the company to which the feedback setting applies
            in cases where the setting refers to an organizational representative
          type: string
          readOnly: true
          example: 15aee472-46ab-4f03-9605-68bd64ebc84a
        filters:
          type: array
          items:
            description: Feedback filter model
            type: object
            properties:
              key:
                description: Unique key for the filter
                type: string
                example: categories
              values:
                description: List of values for the filter
                uniqueItems: true
                type: array
                items:
                  type: string
                example:
                - broadband
                - electricity
          readOnly: true
        channels:
          type: array
          items:
            description: Feedback channel model
            type: object
            properties:
              contactMethod:
                allOf:
                - $ref: '#/components/schemas/ContactMethod'
                - description: Method of contact
                  readOnly: true
                  example: SMS
              destination:
                description: Point of destination
                type: string
                readOnly: true
              sendFeedback:
                description: 'Signal if channel should be used or not when sending
                  feedback '
                type: boolean
                readOnly: true
                example: true
          readOnly: true
        created:
          format: date-time
          description: Timestamp for creation
          type: string
          readOnly: true
          example: 2022-01-20T10:30:09.469+01:00
        modified:
          format: date-time
          description: Timestamp for last modification
          type: string
          readOnly: true
          example: 2022-01-20T10:30:09.469+01:00
        matchingPercent:
          format: int32
          description: Percentual match compared to filters in request
          type: integer
          readOnly: true
          example: 37

Säkerhetsklassning

Säkerhetsklass 1

Autentiseringsmetod: Oauth2

(Ref: Säkerhetsklassning av APIer )

API-ägare

<Kontaktuppgifter till den verksamhet som äger APIets livscykel>

Teknisk ägare

https://sundsvall.atlassian.net/wiki/spaces/API

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

Länkar

FAQ

<FAQ>