---
openapi: 3.0.0
info:
  title: Historical
  version: '2.1'
servers:
- url: https://wappsto.com/services/2.1
  description: Server to connect to the API
components:
  schemas:
    Deletelist:
      title: Deletelist
      type: object
      properties:
        deleted:
          type: array
          items:
            type: string
          description: List of deleted objects
        child_deleted:
          type: array
          items:
            type: string
          description: List of deleted children object related to the chosen objects
            to delete
        shared_deleted:
          type: array
          items:
            type: string
          description: List of removed objects previosly shared and accepted by the
            user
        shared_child_deleted:
          type: array
          items:
            type: string
          description: List of removed children objects previosly shared and accepted
            by the user related to the chosen objects to delete
        not_deleted:
          type: array
          items:
            type: string
          description: List of not deleted objects
        child_not_deleted:
          type: array
          items:
            type: string
          description: List of not deleted children object related to the chosen objects
            to delete
        shared_not_deleted:
          type: array
          items:
            type: string
          description: List of not removed objects previosly shared and accepted by
            the user
        shared_child_not_deleted:
          type: array
          items:
            type: string
          description: List of not removed children objects previosly shared and accepted
            by the user related to the chosen objects to delete
        pending:
          type: array
          items:
            type: string
          description: List of objects that will be deleted eventually
        child_pending:
          type: array
          items:
            type: string
          description: List of children objects that will be deleted eventually
        owned_not_deleted_because_it_has_parent:
          type: array
          items:
            type: string
          description: List of owned object not deleted since they have a parent
        shared_not_deleted_because_it_has_parent:
          type: array
          items:
            type: string
          description: List of shared object not deleted since they have a parent
        code:
          type: integer
          description: Code of the deletion
        message:
          type: string
          description: Final status of the deletion
        error:
          type: string
          description: Possible incurred errors
        meta:
          type: object
          description: Meta data of the object
        unsuccessful:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              message:
                type: string
              data:
                type: object
          description: An array that includes a more deep description about the reason
            of unsuccessful deletions
      additionalProperties: false
      description: Output obtained when one or multiple objects are deleted with a
        DELETE request
    Httpresponse:
      title: Httpresponse
      type: object
      properties:
        message:
          type: string
          description: Message of the error
        data:
          type: object
          description: More information about the error
        code:
          type: integer
          description: Identifier code of the error
        service:
          type: string
          description: Service that sent the error
        meta:
          type: object
          description: Meta data of the object
      additionalProperties: false
      description: Output obtain when a fast communication is returned (usually an
        error)
    Idlist:
      title: Idlist
      type: object
      properties:
        id:
          items:
            type: string
            pattern: "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
          type: array
          description: Ids found
        more:
          type: boolean
          description: If true, it means that using offset it is possible to retrieve
            other values
        limit:
          type: integer
          multipleOf: 1
          minimum: 1
          description: Limit used to retrieve the ids
        count:
          type: integer
          multipleOf: 1
          minimum: 0
          description: Number of ids returned
        data:
          type: object
          description: Further information in relation of the service
        child:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
              version:
                type: string
                pattern: "(\\d+)\\.(\\d+)"
          description: It is an array that gives a brief description of the type and
            the version of the retrieved objects
        meta:
          type: object
      additionalProperties: false
      description: Output obtain when a list is returned
    Fetch:
      title: Fetch
      type: object
      properties:
        filter:
          type: object
        return:
          type: string
          description: A graphQL string that describes the format it needs to be returned
        table:
          type: boolean
          description: If true, use iot table to fetch the data
        data:
          type: object
          description: The output obtained after filtering and parsing the results
            with the GraphQL request
        meta:
          type: object
          description: Meta data of the object
      additionalProperties: false
      description: Output obtained when the input is a fetch request
    Log:
      title: Log
      type: object
      properties:
        more:
          type: boolean
          description: More data can retrieved by using offset
          example: false
        type:
          type: string
          description: Type of the analyzed object
          example: object
        data:
          items:
            type: object
            additionalProperties: false
            properties:
              time:
                type: string
              data:
                oneOf:
                - type: string
                - type: number
              raw:
                type: string
            required:
            - time
            - data
          type: array
          description: Data obtained as output
          example: []
        meta:
          type: object
          actual_start:
            type: string
            format: date-time
          actual_end:
            type: string
            format: date-time
          description: Meta data of the object
          example:
            id: ce705edc-a0e9-4d09-aad8-fd391f282709
            type: log
            version: '2.1'
      additionalProperties: false
      description: A log is used to retrieve the historical data of an object, a state,
        an event, an application or the usage of a state
  parameters:
    url_id:
      name: :id
      in: path
      required: true
      description: Id of the given object
      schema:
        type: string
        pattern: "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
    url_hex:
      name: :token
      in: path
      required: true
      description: Token used for some operation
      schema:
        type: string
        pattern: "^[0-9a-fA-F]{64}$"
tags:
- name: Log
  description: A log is used to retrieve the historical data of an object, a state,
    an event, an application or the usage of a state
paths:
  "/log/:id":
    get:
      tags:
      - Log
      summary: Retrieve historical of an object
      parameters:
      - "$ref": "#/components/parameters/url_id"
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/Log"
              example:
                meta:
                  id: ce705edc-a0e9-4d09-aad8-fd391f282709
                  type: log
                  version: '2.1'
                data:
                - time: '2021-03-23T11:43:40.628012Z'
                  name: Phust HD Audible Ferrule
                - time: '2021-03-23T11:43:40.643912Z'
                  name: Phiphwood Performance Power Ferrule
                - time: '2021-03-23T11:43:40.652978Z'
                  name: Subsync GPS Tag Receiver
                more: false
                type: object
  "/log/:id/online_iot":
    get:
      tags:
      - Log
      summary: Retrieve historical of online status of a network
      parameters:
      - "$ref": "#/components/parameters/url_id"
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/Log"
              example:
                meta:
                  id: b4e325d6-2f75-45cb-b9cd-b7a1b7067f23
                  type: log
                  version: '2.1'
                data:
                - time: '2021-03-23T11:43:42.31885Z'
                  is_online: false
                - time: '2021-03-23T11:43:42.551622Z'
                  is_online: true
                - time: '2021-03-23T11:43:42.624871Z'
                  is_online: false
                - time: '2021-03-23T11:43:42.839189Z'
                  is_online: true
                - time: '2021-03-23T11:43:42.919778Z'
                  is_online: false
                - time: '2021-03-23T11:43:43.139387Z'
                  is_online: true
                more: false
                type: online_iot
  "/log/:id/state":
    get:
      tags:
      - Log
      summary: Retrieve historical of a state
      parameters:
      - "$ref": "#/components/parameters/url_id"
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/Log"
              example:
                meta:
                  id: 6472ec0c-95f4-4795-86e9-f312e6a1ebab
                  type: log
                  version: '2.1'
                data:
                - data: '64'
                  time: '2021-03-23T11:43:47.580724Z'
                - data: '0'
                  time: '2021-03-23T11:43:47.60131Z'
                - data: '1'
                  time: '2021-03-23T11:43:47.611314Z'
                - data: '2'
                  time: '2021-03-23T11:43:47.619386Z'
                - data: '3'
                  time: '2021-03-23T11:43:47.627342Z'
                - data: '4'
                  time: '2021-03-23T11:43:47.634436Z'
                - data: '5'
                  time: '2021-03-23T11:43:47.641926Z'
                - data: '6'
                  time: '2021-03-23T11:43:47.648119Z'
                - data: '7'
                  time: '2021-03-23T11:43:47.654659Z'
                - data: '8'
                  time: '2021-03-23T11:43:47.66205Z'
                - data: '9'
                  time: '2021-03-23T11:43:47.66802Z'
                - data: '10'
                  time: '2021-03-23T11:43:47.674988Z'
                - data: '11'
                  time: '2021-03-23T11:43:47.68116Z'
                - data: '12'
                  time: '2021-03-23T11:43:47.68749Z'
                - data: '13'
                  time: '2021-03-23T11:43:47.693348Z'
                - data: '14'
                  time: '2021-03-23T11:43:47.699353Z'
                - data: '15'
                  time: '2021-03-23T11:43:47.706294Z'
                - data: '16'
                  time: '2021-03-23T11:43:47.712505Z'
                - data: '17'
                  time: '2021-03-23T11:43:47.71935Z'
                - data: '18'
                  time: '2021-03-23T11:43:47.726101Z'
                - data: '19'
                  time: '2021-03-23T11:43:47.731952Z'
                - data: '20'
                  time: '2021-03-23T11:43:47.738091Z'
                - data: '21'
                  time: '2021-03-23T11:43:47.743726Z'
                - data: '22'
                  time: '2021-03-23T11:43:47.750906Z'
                - data: '23'
                  time: '2021-03-23T11:43:47.7585Z'
                - data: '24'
                  time: '2021-03-23T11:43:47.778263Z'
                - data: '25'
                  time: '2021-03-23T11:43:47.786071Z'
                - data: '26'
                  time: '2021-03-23T11:43:47.791582Z'
                - data: '27'
                  time: '2021-03-23T11:43:47.798459Z'
                - data: '28'
                  time: '2021-03-23T11:43:47.804173Z'
                - data: '29'
                  time: '2021-03-23T11:43:47.809676Z'
                - data: '30'
                  time: '2021-03-23T11:43:47.815275Z'
                - data: '31'
                  time: '2021-03-23T11:43:47.821353Z'
                - data: '32'
                  time: '2021-03-23T11:43:47.827062Z'
                - data: '33'
                  time: '2021-03-23T11:43:47.832747Z'
                - data: '34'
                  time: '2021-03-23T11:43:47.838431Z'
                - data: '35'
                  time: '2021-03-23T11:43:47.844253Z'
                - data: '36'
                  time: '2021-03-23T11:43:47.849586Z'
                - data: '37'
                  time: '2021-03-23T11:43:47.855366Z'
                - data: '38'
                  time: '2021-03-23T11:43:47.861203Z'
                - data: '39'
                  time: '2021-03-23T11:43:47.867292Z'
                - data: '40'
                  time: '2021-03-23T11:43:47.873698Z'
                - data: '41'
                  time: '2021-03-23T11:43:47.878988Z'
                - data: '42'
                  time: '2021-03-23T11:43:47.884621Z'
                - data: '43'
                  time: '2021-03-23T11:43:47.891076Z'
                - data: '44'
                  time: '2021-03-23T11:43:47.898502Z'
                - data: '45'
                  time: '2021-03-23T11:43:47.904382Z'
                - data: '46'
                  time: '2021-03-23T11:43:47.910069Z'
                - data: '47'
                  time: '2021-03-23T11:43:47.916726Z'
                - data: '48'
                  time: '2021-03-23T11:43:47.92377Z'
                - data: '49'
                  time: '2021-03-23T11:43:47.929166Z'
                - data: '50'
                  time: '2021-03-23T11:43:47.935275Z'
                - data: '51'
                  time: '2021-03-23T11:43:47.94134Z'
                - data: '52'
                  time: '2021-03-23T11:43:47.947984Z'
                - data: '53'
                  time: '2021-03-23T11:43:47.956022Z'
                - data: '54'
                  time: '2021-03-23T11:43:47.962239Z'
                - data: '55'
                  time: '2021-03-23T11:43:47.968116Z'
                - data: '56'
                  time: '2021-03-23T11:43:47.973921Z'
                - data: '57'
                  time: '2021-03-23T11:43:47.979155Z'
                - data: '58'
                  time: '2021-03-23T11:43:47.984459Z'
                - data: '59'
                  time: '2021-03-23T11:43:47.989904Z'
                - data: '60'
                  time: '2021-03-23T11:43:47.99525Z'
                - data: '61'
                  time: '2021-03-23T11:43:48.000899Z'
                - data: '62'
                  time: '2021-03-23T11:43:48.00673Z'
                - data: '63'
                  time: '2021-03-23T11:43:48.012066Z'
                - data: '64'
                  time: '2021-03-23T11:43:48.017791Z'
                - data: '65'
                  time: '2021-03-23T11:43:48.025129Z'
                - data: '66'
                  time: '2021-03-23T11:43:48.030091Z'
                - data: '67'
                  time: '2021-03-23T11:43:48.035399Z'
                - data: '68'
                  time: '2021-03-23T11:43:48.040682Z'
                - data: '69'
                  time: '2021-03-23T11:43:48.04667Z'
                - data: '70'
                  time: '2021-03-23T11:43:48.052173Z'
                - data: '71'
                  time: '2021-03-23T11:43:48.057496Z'
                - data: '72'
                  time: '2021-03-23T11:43:48.062934Z'
                - data: '73'
                  time: '2021-03-23T11:43:48.068278Z'
                - data: '74'
                  time: '2021-03-23T11:43:48.075114Z'
                - data: '75'
                  time: '2021-03-23T11:43:48.083707Z'
                - data: '76'
                  time: '2021-03-23T11:43:48.089071Z'
                - data: '77'
                  time: '2021-03-23T11:43:48.094557Z'
                - data: '78'
                  time: '2021-03-23T11:43:48.101607Z'
                - data: '79'
                  time: '2021-03-23T11:43:48.10765Z'
                - data: '80'
                  time: '2021-03-23T11:43:48.11387Z'
                - data: '81'
                  time: '2021-03-23T11:43:48.121814Z'
                - data: '82'
                  time: '2021-03-23T11:43:48.128452Z'
                - data: '83'
                  time: '2021-03-23T11:43:48.133789Z'
                - data: '84'
                  time: '2021-03-23T11:43:48.138992Z'
                - data: '85'
                  time: '2021-03-23T11:43:48.144693Z'
                - data: '86'
                  time: '2021-03-23T11:43:48.151421Z'
                - data: '87'
                  time: '2021-03-23T11:43:48.156684Z'
                - data: '88'
                  time: '2021-03-23T11:43:48.162563Z'
                - data: '89'
                  time: '2021-03-23T11:43:48.169272Z'
                - data: '90'
                  time: '2021-03-23T11:43:48.175085Z'
                - data: '91'
                  time: '2021-03-23T11:43:48.180247Z'
                - data: '92'
                  time: '2021-03-23T11:43:48.185948Z'
                - data: '93'
                  time: '2021-03-23T11:43:48.191427Z'
                - data: '94'
                  time: '2021-03-23T11:43:48.1968Z'
                - data: '95'
                  time: '2021-03-23T11:43:48.202425Z'
                - data: '96'
                  time: '2021-03-23T11:43:48.208042Z'
                - data: '97'
                  time: '2021-03-23T11:43:48.217715Z'
                more: false
                type: state
