TagoIO Entity Data API

Operations specific to managing entitie stored data (Profile Token)

OpenAPI Specification

tago-io-entity-data-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: TagoIO Access Management Entity Data API
  description: "#### **How to use this documentation**\nThe documentation is split by which token you're required to use in the request.  \nTagoIO provides 4 different tokens:\n- **Device-Token**: The token from your device, which you can get from the device's page.\n    \n- **Profile-Token**: Also know as Account-Token. You get from your profile settings page.\n    \n- **Network-Token**: Is the token from your Network. Only available if you're owner of the network in your integrations page.\n    \n- **Analysis-Token:** The token from your analysis, available in the analysis page.\n---\n#### Setting the API Endpoint Region\nWhen making a request to the TagoIO API, you must also specify the appropriate regional endpoint. Choose one of the following endpoints based on your geographical region:\n\n- **United States East 1:**  \n    Use this endpoint when your application is based in the eastern United States.  \n    **URL:** `https://api.us-e1.tago.io/`\n    \n- **Europe West 1:**  \n    Use this endpoint when your application is based in Western Europe.  \n    **URL:** `https://api.eu-w1.tago.io/`\n\n- **Tago Deploy:**  \n  You should use your own API URL that is available in your Domains section of the TagoDeploy."
  version: 1.0.0
  contact: {}
servers:
- url: https://api.us-e1.tago.io
- url: https://api.eu-w1.tago.io
security:
- ProfileToken: []
tags:
- name: Entity Data
  description: Operations specific to managing entitie stored data (Profile Token)
paths:
  /entity/{entity_id}/data_amount:
    parameters:
    - name: entity_id
      in: path
      required: true
      schema:
        type: string
        example: (Type an entity ID)
    get:
      tags:
      - Entity Data
      summary: Entity Data Amount
      description: Get Entity Data Amount
      operationId: getEntityDataAmount
      responses:
        '200':
          description: Getting entity data amount
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: number
                    example: 100
                  status:
                    type: boolean
                    example: true
              examples:
                Getting entity data amount:
                  value:
                    result: 100
                    status: true
  /entity/{entity_id}/data:
    parameters:
    - name: entity_id
      in: path
      required: true
      schema:
        type: string
        example: (Type an entity ID)
    description: Entity ID
    get:
      tags:
      - Entity Data
      summary: Get Entity Data
      description: Get Entity Data
      operationId: getEntityData
      parameters:
      - name: page
        in: query
        schema:
          type: string
          example: number
        description: (default 1)
      - name: amount
        in: query
        schema:
          type: string
          example: number
        description: '(default: 20, max: 1000)'
      - name: fields
        in: query
        schema:
          type: string
          example: ''
        description: comma-separated list of fields to return
      - name: order_by
        in: query
        schema:
          type: string
          example: asc/desc
      - name: filter
        in: query
        schema:
          type: string
          example: ''
        description: JSON object. Filter by an entity field. Requires the index paramenter
      - name: index
        in: query
        required: true
        schema:
          type: string
        description: First index searchable field from the entity field added to the filter parameter
      responses:
        '200':
          description: Getting entity data by filter
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: array
                    items:
                      type: object
                      properties:
                        charge_amount:
                          example: null
                        created_at:
                          type: string
                          example: '2024-11-06T11:32:36.467Z'
                        id:
                          type: string
                          example: 672b53d43bc47400095f3831
                        int_field:
                          example: null
                        monthly_revenue:
                          type: number
                          example: 2345.34
                        update_date:
                          type: string
                          example: '2024-11-01T03:00:00.000Z'
                        updated_at:
                          type: string
                          example: '2024-11-06T11:32:36.467Z'
                    example:
                    - charge_amount: null
                      created_at: '2024-11-06T11:32:36.467Z'
                      id: 672b53d43bc47400095f3831
                      int_field: null
                      monthly_revenue: 2345.34
                      update_date: '2024-11-01T03:00:00.000Z'
                      updated_at: '2024-11-06T11:32:36.467Z'
                    - charge_amount: null
                      created_at: '2024-11-06T11:34:33.380Z'
                      id: 672b5449dbac110009ce878f
                      int_field: null
                      monthly_revenue: 2193.43
                      update_date: '2024-10-01T03:00:00.000Z'
                      updated_at: '2024-11-06T11:34:33.380Z'
                    - charge_amount: null
                      created_at: '2024-11-06T11:34:47.772Z'
                      id: 672b54573bc47400095f4634
                      int_field: null
                      monthly_revenue: 2889.23
                      update_date: '2024-09-01T03:00:00.000Z'
                      updated_at: '2024-11-06T11:34:47.772Z'
                  status:
                    type: boolean
                    example: true
              examples:
                Getting entity data by filter:
                  value:
                    result:
                    - charge_amount: null
                      created_at: '2024-11-06T11:32:36.467Z'
                      id: 672b53d43bc47400095f3831
                      int_field: null
                      monthly_revenue: 2345.34
                      update_date: '2024-11-01T03:00:00.000Z'
                      updated_at: '2024-11-06T11:32:36.467Z'
                    - charge_amount: null
                      created_at: '2024-11-06T11:34:33.380Z'
                      id: 672b5449dbac110009ce878f
                      int_field: null
                      monthly_revenue: 2193.43
                      update_date: '2024-10-01T03:00:00.000Z'
                      updated_at: '2024-11-06T11:34:33.380Z'
                    - charge_amount: null
                      created_at: '2024-11-06T11:34:47.772Z'
                      id: 672b54573bc47400095f4634
                      int_field: null
                      monthly_revenue: 2889.23
                      update_date: '2024-09-01T03:00:00.000Z'
                      updated_at: '2024-11-06T11:34:47.772Z'
                    status: true
    put:
      tags:
      - Entity Data
      summary: Edit Entity Data
      description: Edit Entity Data
      operationId: editEntityData
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: string
                  example: 672b5449dbac110009ce878f
                monthly_revenue:
                  type: number
                  example: 1239.45
            examples:
              Edit Entity Data:
                value:
                  id: 672b5449dbac110009ce878f
                  monthly_revenue: 1239.45
      responses:
        '200':
          description: Editing an entity data
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: 1 item(s) updated
                  status:
                    type: boolean
                    example: true
              examples:
                Editing an entity data:
                  value:
                    result: 1 item(s) updated
                    status: true
    post:
      tags:
      - Entity Data
      summary: Add Entity Data
      description: Add Entity Data
      operationId: addEntityData
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                monthly_revenue:
                  type: number
                  example: 2345.34
                update_date:
                  type: string
                  example: '2024-11-01T03:00:00.000Z'
            examples:
              Add Entity Data:
                value:
                  monthly_revenue: 2345.34
                  update_date: '2024-11-01T03:00:00.000Z'
      responses:
        '200':
          description: Add Entity Data
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: 1 Data Added
                  status:
                    type: boolean
                    example: true
              examples:
                Add Entity Data:
                  value:
                    result: 1 Data Added
                    status: true
    delete:
      tags:
      - Entity Data
      summary: Delete Entity Data
      description: Delete Entity Data
      operationId: deleteEntityData
      responses:
        '200':
          description: Delete Entity Data
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: 2 item(s) deleted
                  status:
                    type: boolean
                    example: true
              examples:
                Delete Entity Data:
                  value:
                    result: 2 item(s) deleted
                    status: true
  /entity/{entity_id}/data/backup:
    post:
      tags:
      - Entity Data
      summary: Export Entity Data
      description: 'Export data from the entity to a file in the Files.

        '
      operationId: exportEntityData
      parameters:
      - name: entity_id
        in: path
        required: true
        schema:
          type: string
        description: Entity ID
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                file_address:
                  type: string
                  example: /my_data/export.csv
                  description: Path in the Files to save the export.
                headers:
                  type: boolean
                  example: true
                  description: Whether to include headers in the export.
              required:
              - file_address
      responses:
        '200':
          description: Exporting data
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: object
                    properties:
                      file_address:
                        type: string
                        example: /my_data/export.csv
                  status:
                    type: boolean
                    example: true
components:
  securitySchemes:
    Device-Token:
      type: apiKey
      description: A Device-Token that is unique to your device. Generate a token by accessing your Device's page.
      name: Device-Token
      in: header
      x-example: 5e12345a-d70a-4e2d-b83d-5c0123456789
    Network-Token:
      type: apiKey
      description: A Network Token that is unique to your Network. Access Integrations > Network > Tokens to generate a token for your Network.
      name: Token
      in: header
      x-DisplayName: Network-Token
      x-example: fd549ad2-813c-4d66-bf72-508e5b98afe3
    Profile-Token:
      type: apiKey
      description: A Profile token that is unique to your entire profile. Generate in your account settings.
      name: Profile-Token
      in: header
      x-example: a15ea5ea-dd2d-4c63-8945-92b54da4772a
x-tagGroups:
- name: Device Token (Device-level)
  tags:
  - Device Data
- name: Network Token (Network-level)
  tags:
  - Network Ingest
- name: Device Management
  tags:
  - Devices
  - Device Tokens
  - Configuration Param
  - Import/Export
  - Immutable Device
- name: Tago RUN
  tags:
  - Tago RUN
  - Users
  - Dictionary
  - Notifications
- name: Dashboards
  tags:
  - Dashboards
  - Widgets
- name: File(s) Management
  tags:
  - Files
  - Upload
- name: Profile
  tags:
  - Account
  - Profile
  - Statistics / Billing
- name: Entities
  tags:
  - Entity
  - Entity Data
- name: Resources
  tags:
  - Access Management