WeFitter notification API

Send a notification to all devices for the specified profiles The data will be sent to the client in the following format: ``` { "app": , "title": , "body": , "link": } ```

OpenAPI Specification

wefitter-notification-api-openapi.yml Raw ↑
swagger: '2.0'
info:
  title: WeFitter app notification API
  description: This is the WeFitter API
  termsOfService: https://www.wefitter.com/privacy/
  contact:
    email: hello@wefitter.com
  license:
    name: BSD License
  version: v1.3
host: api.wefitter.com
basePath: /api/v1.3
schemes:
- https
consumes:
- application/json
produces:
- application/json
security:
- BearerProfile: []
tags:
- name: notification
  description: "Send a notification to all devices for the specified profiles\nThe data will be sent to the client in the following format:\n```\n{\n        \"app\": <app public id>,\n        \"title\": <title>,\n        \"body\": <body>,\n        \"link\": <optional link>\n}\n```\n"
paths:
  /notification/send_to_all/:
    parameters: []
    post:
      operationId: notification_send_to_all_create
      summary: Notification to all profiles in app
      description: Send a notification to all registered devices in the app.
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/Notification'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/Notification'
      tags:
      - notification
      security:
      - BearerAdmin: []
      deprecated: false
  /notification/send_to_profiles/:
    parameters: []
    post:
      operationId: notification_send_to_profiles_create
      summary: Notification to specific profiles
      description: Send a notification to all registered devices for the specified profiles.
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/NotificationForProfiles'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/NotificationForProfiles'
      tags:
      - notification
      security:
      - BearerAdmin: []
      deprecated: false
definitions:
  Notification:
    required:
    - title
    - body
    type: object
    properties:
      title:
        title: Title
        type: string
        maxLength: 512
        minLength: 1
      body:
        title: Body
        type: string
        maxLength: 2048
        minLength: 1
      schedule:
        title: Schedule
        description: date and time to send notification
        type: string
        format: date-time
        x-nullable: true
      link:
        title: Link
        type: string
        maxLength: 1024
  NotificationForProfiles:
    required:
    - title
    - body
    - profiles
    type: object
    properties:
      title:
        title: Title
        type: string
        maxLength: 512
        minLength: 1
      body:
        title: Body
        type: string
        maxLength: 2048
        minLength: 1
      schedule:
        title: Schedule
        description: date and time to send notification
        type: string
        format: date-time
        x-nullable: true
      link:
        title: Link
        type: string
        maxLength: 1024
      profiles:
        type: array
        items:
          description: The profiles to send the push notification to
          type: string
          format: uuid
securityDefinitions:
  Basic:
    type: basic
    description: 'Basic Authentication is used to create administrator bearer tokens.


      Once a bearer token has been made, remove this auth. (''logout'' in Swagger'')'
  BearerProfile:
    type: apiKey
    name: Authorization
    in: header
    description: 'Bearer authentication for logged-in profiles.


      When using the GUI, please don''t forget to prefix your bearer tokens with the text ''bearer'', followed by a space.'
  BearerAdmin:
    type: apiKey
    name: Authorization
    in: header
    description: 'Bearer authentication for administrators.


      When using the GUI, please don''t forget to prefix your bearer tokens with the text ''bearer'', followed by a space.'