TagoIO Notifications API

Manage notifications (Profile Token).

OpenAPI Specification

tago-io-notifications-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: TagoIO Access Management Notifications 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: Notifications
  description: Manage notifications (Profile Token).
paths:
  /run/notification:
    post:
      tags:
      - Notifications
      summary: Create Notification
      description: 'Create Notification for an user

        '
      operationId: createNotification
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                buttons:
                  type: array
                  items:
                    type: object
                    properties:
                      analysis:
                        type: string
                        example: 5515de2676ab4e3211109e41c
                      color:
                        type: string
                        example: green
                      id:
                        type: string
                        example: btn_1249384
                      label:
                        type: string
                        example: Acknowledge
                  example:
                  - analysis: 5515de2676ab4e3211109e41c
                    color: green
                    id: btn_1249384
                    label: Acknowledge
                buttons_autodisable:
                  type: boolean
                  example: true
                buttons_enabled:
                  type: boolean
                  example: true
                message:
                  type: string
                  example: The temperature is lower than 18ºC.
                run_user:
                  type: string
                  example: 614edef8749df6a30280012a3caef
                title:
                  type: string
                  example: Low Temperature
            examples:
              Create Notification:
                value:
                  buttons:
                  - analysis: 5515de2676ab4e3211109e41c
                    color: green
                    id: btn_1249384
                    label: Acknowledge
                  buttons_autodisable: true
                  buttons_enabled: true
                  message: The temperature is lower than 18ºC.
                  run_user: 614edef8749df6a30280012a3caef
                  title: Low Temperature
          text/plain:
            examples:
              Create Notification:
                value: "{\r\n    \"run_user\": \"<Run User ID>\",\r\n    \"title\": \"notification title\",\r\n    \"message\": \"message to be read\",\r\n    \"buttons\": [ // optional\r\n        {\r\n            \"label\": \"label of the button\",\r\n            \"id\": \"id_of_the_button\", // no space allowed\r\n            \"color\": \"color of the button\", //hexadecimal allowed\r\n            \"url\": \"url to redirect the user\", //optional\r\n            \"analysis\": \"analysis to run when clicked\" //optional\r\n        }\r\n    ],\r\n    \"buttons_enabled\": true, // optional\r\n    \"buttons_autodisable\": true // optional\r\n}"
      responses:
        '200':
          description: Creating a RUN notification
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: object
                    properties:
                      id:
                        type: string
                        example: 3415de2676ff4e2001109e63b
                  status:
                    type: boolean
                    example: true
              examples:
                Creating a RUN notification:
                  value:
                    result:
                      id: 3415de2676ff4e2001109e63b
                    status: true
  /run/notification/{userID}:
    parameters:
    - name: userID
      in: path
      required: true
      schema:
        type: string
        example: (Type a RUN user ID)
    get:
      tags:
      - Notifications
      summary: List Notifications
      description: 'List of notifications for an user

        '
      operationId: listOfNotifications
      responses:
        '200':
          description: List of the Run user notifications
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: array
                    items:
                      type: object
                      properties:
                        buttons:
                          type: array
                          items: {}
                          example: []
                        buttons_autodisable:
                          type: boolean
                          example: true
                        buttons_enabled:
                          type: boolean
                          example: true
                        created_at:
                          type: string
                          example: '2022-06-20T17:35:26.753Z'
                        id:
                          type: string
                          example: 62b0afde27ce4d0012c62256
                        message:
                          type: string
                          example: Your device has retuned to the regular temperature
                        read:
                          type: boolean
                          example: false
                        title:
                          type: string
                          example: Temperature back to normal
                    example:
                    - buttons: []
                      buttons_autodisable: true
                      buttons_enabled: true
                      created_at: '2022-06-20T17:35:26.753Z'
                      id: 62b0afde27ce4d0012c62256
                      message: Your device has retuned to the regular temperature
                      read: false
                      title: Temperature back to normal
                    - buttons: []
                      buttons_autodisable: true
                      buttons_enabled: true
                      created_at: '2022-05-26T13:12:06.753Z'
                      id: 62b0afde27ce4d0012c62286
                      message: The temperature is lower than 18ºC.
                      read: true
                      title: Low Temperature
                  status:
                    type: boolean
                    example: true
  /run/notification/{notificationID}:
    parameters:
    - name: notificationID
      in: path
      required: true
      schema:
        type: string
        example: (Type your RUN notification ID)
    put:
      tags:
      - Notifications
      summary: Edit Notification
      description: 'Edit notification on Run

        '
      operationId: editNotification
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                buttons_enabled:
                  type: boolean
                  example: true
                message:
                  type: string
                  example: new notification message
                read:
                  type: boolean
                  example: true
                title:
                  type: string
                  example: new notification title
      responses:
        '200':
          description: Editing a RUN user notification
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: TagoIO Notification User Successfully Updated
                  status:
                    type: boolean
                    example: true
    delete:
      tags:
      - Notifications
      summary: Delete Notification
      description: 'Delete notification on Run

        '
      operationId: deleteNotification
      responses:
        '200':
          description: Deleting a RUN user notification
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: Successfully Removed
                  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