> ## Documentation Index
> Fetch the complete documentation index at: https://developer.energy-hub.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Refresh charger data

> Updates charger with newest data from vendor system.



## OpenAPI

````yaml get /v1.0.0/chargers/{chargerId}/refresh
openapi: 3.0.1
info:
  description: A service used for chargers
  title: charger-service
  version: 1.0.0
servers:
  - description: Generated server url
    url: https://api.energy-hub.io
security: []
paths:
  /v1.0.0/chargers/{chargerId}/refresh:
    get:
      tags:
        - Charger Controller
      summary: Refresh charger data
      description: Updates charger with newest data from vendor system.
      operationId: refreshCharger
      parameters:
        - schema:
            format: uuid
            type: string
          in: path
          name: chargerId
          description: Charger ID
          required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChargerResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessageDto'
              examples:
                UNAUTHORIZED:
                  $ref: '#/components/examples/UNAUTHORIZED'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessageDto'
              examples:
                CHARGER_NOT_FOUND:
                  $ref: '#/components/examples/CHARGER_NOT_FOUND'
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessageDto'
              examples:
                VENDOR_ACCOUNT_IS_DISCONNECTED:
                  $ref: '#/components/examples/VENDOR_ACCOUNT_IS_DISCONNECTED'
                VENDOR_COMMUNICATION_ERROR:
                  $ref: '#/components/examples/VENDOR_COMMUNICATION_ERROR'
                DEVICE_IS_DISCONNECTED:
                  $ref: '#/components/examples/DEVICE_IS_DISCONNECTED'
                VENDOR_AUTHENTICATION_ERROR:
                  $ref: '#/components/examples/VENDOR_AUTHENTICATION_ERROR'
                VENDOR_CONNECTION_ERROR:
                  $ref: '#/components/examples/VENDOR_CONNECTION_ERROR'
      security:
        - API_Key: []
components:
  schemas:
    ChargerResponse:
      description: Object of charger response.
      type: object
      required:
        - id
        - isOnline
        - userId
      properties:
        lastUpdated:
          format: date-time
          description: The timestamp of the last update of any field in the charger data.
          type: string
        chargeState:
          $ref: '#/components/schemas/ChargeState'
        locationId:
          format: uuid
          description: Object of the location of the charger.
          type: string
        isOnline:
          description: Indicates if the charger is reachable trough the vendor system.
          type: boolean
          example: true
        id:
          format: uuid
          description: The ID of the charger.
          type: string
        userId:
          description: The ID of the user.
          type: string
          example: 896f9d5a-b618-48a2-98ae-957059bf1bc9
        staticData:
          $ref: '#/components/schemas/StaticData'
    ErrorMessageDto:
      type: object
      required:
        - errorCode
        - id
        - message
      properties:
        errorCode:
          description: The error code
          type: string
          example: EXAMPLE_ERROR_CODE
        id:
          format: uuid
          description: The error identifier
          type: string
          example: 7958818d-64d2-4ede-b12b-4786dd2f348b
        message:
          description: The error message
          type: string
          example: Example error message
    ChargeState:
      description: Object of charge state data of a charger.
      type: object
      required:
        - lastUpdated
      properties:
        chargeRate:
          format: double
          description: The rate of the charge while the charger is charging in kW.
          type: number
          example: 6.512
        lastUpdated:
          format: date-time
          description: The timestamp of the last update of the charge state data.
          type: string
        chargeCurrentMax:
          format: double
          description: The maximum charging current in amperes.
          type: number
          example: 12
        isPlugged:
          description: Indicates if the charger is plugged in.
          type: boolean
          example: true
        activePhases:
          format: double
          description: The number of active phases during the charging process.
          type: number
          example: 1
        chargingState:
          description: The current charging state.
          type: string
          enum:
            - UNPLUGGED
            - CHARGING
            - PREPARING
            - FINISHED
            - STOPPED
            - FAULT
    StaticData:
      description: Object of static data of a charger.
      type: object
      required:
        - lastUpdated
        - model
        - vendor
      properties:
        lastUpdated:
          format: date-time
          description: The timestamp of the last update of the static data.
          type: string
        vendor:
          description: The vendor of the charger.
          type: string
          enum:
            - EASEE
            - GO_E
            - ZAPTEC
        name:
          description: The name of the charger.
          type: string
          example: My charger
        model:
          description: The model of the charger.
          type: string
          example: Wallbox
  examples:
    UNAUTHORIZED:
      value:
        errorCode: UNAUTHORIZED
        id: 9f68c660-b11c-4531-8f0d-b0864117ecbe
        message: Unauthorized
    CHARGER_NOT_FOUND:
      value:
        errorCode: CHARGER_NOT_FOUND
        id: 9f68c660-b11c-4531-8f0d-b0864117ecbe
        message: '[CHARGER] Requested Charger not found'
    VENDOR_ACCOUNT_IS_DISCONNECTED:
      value:
        errorCode: VENDOR_ACCOUNT_IS_DISCONNECTED
        id: 9f68c660-b11c-4531-8f0d-b0864117ecbe
        message: '[VENDOR_ACCOUNT] Vendor account is disconnected'
    VENDOR_COMMUNICATION_ERROR:
      value:
        errorCode: VENDOR_COMMUNICATION_ERROR
        id: 9f68c660-b11c-4531-8f0d-b0864117ecbe
        message: '[VENDOR API] Communication error with Vendor API'
    DEVICE_IS_DISCONNECTED:
      value:
        errorCode: DEVICE_IS_DISCONNECTED
        id: 9f68c660-b11c-4531-8f0d-b0864117ecbe
        message: Device disconnected
    VENDOR_AUTHENTICATION_ERROR:
      value:
        errorCode: VENDOR_AUTHENTICATION_ERROR
        id: 9f68c660-b11c-4531-8f0d-b0864117ecbe
        message: '[VENDOR API] Authentication error with Vendor API'
    VENDOR_CONNECTION_ERROR:
      value:
        errorCode: VENDOR_CONNECTION_ERROR
        id: 9f68c660-b11c-4531-8f0d-b0864117ecbe
        message: '[VENDOR API] Connection cannot be established with Vendor API'
  securitySchemes:
    API_Key:
      in: header
      name: X-API-KEY
      description: API key used for authorization and authentication.
      type: apiKey

````