Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- openapi: 3.0.0
- info:
- title: PubNub Signals
- description: API for Signaling
- contact:
- name: API Support
- url: https://pubnub.com/support
- email: support@pubnub.com
- version: 0.0.1
- servers:
- - url: https://ps.pndsn.com
- paths:
- /signal/{pub_key}/{sub_key}/0/{channel}/{callback}/{payload}:
- get:
- tags:
- - Signal (GET)
- summary: Signal a message to a channel
- description: This resource allows a developer to Signal a message to a channel
- operationId: SignalGET
- parameters:
- - name: pub_key
- in: path
- description: 'Your PubNub Publish API Key '
- required: true
- style: simple
- explode: false
- schema:
- type: string
- - name: sub_key
- in: path
- description: 'Your PubNub Subscribe API Key '
- required: true
- style: simple
- explode: false
- schema:
- type: string
- - name: channel
- in: path
- description: The channel name you wish to signal
- required: true
- style: simple
- explode: false
- schema:
- type: string
- - name: callback
- in: path
- description: The JSONP callback
- required: true
- style: simple
- explode: false
- schema:
- type: string
- - name: payload
- in: path
- description: The message body as a JSON blob to Signal
- required: true
- schema:
- type: object
- - name: uuid
- in: query
- description: A unique alphanumeric ID for identifying the client to the PubNub
- Presence System, as well as for PubNub Analytics.
- style: form
- explode: true
- schema:
- type: string
- - name: auth
- in: query
- description: If the channel is protected by PAM, auth must be passed with
- a key which is authorized to publish to the channel.
- style: form
- explode: true
- schema:
- type: string
- - name: meta
- in: query
- description: Optional meta field
- style: form
- explode: true
- schema:
- type: object
- responses:
- 200:
- $ref: '#/components/responses/Success'
- 400:
- $ref: '#/components/responses/BadRequest'
- 403:
- $ref: '#/components/responses/Forbidden'
- 404:
- $ref: '#/components/responses/NotFound'
- 413:
- $ref: '#/components/responses/TooLargeBody'
- 429:
- $ref: '#/components/responses/RateLimited'
- /v2/subscribe/{sub_key}/{channel}/{callback}:
- get:
- tags:
- - Subscribe (GET)
- summary: Subscribe to PubNub
- description: This resource allows a developer to Subscribe to PubNub
- operationId: SubscribeGET
- parameters:
- - name: sub_key
- in: path
- description: 'Your PubNub Subscribe API Key '
- required: true
- style: simple
- explode: false
- schema:
- type: string
- - name: channel
- in: path
- description: The channel name you wish to signal
- required: true
- style: simple
- explode: false
- schema:
- type: string
- - name: callback
- in: path
- description: The JSONP callback
- required: true
- style: simple
- explode: false
- schema:
- type: string
- - name: tt
- in: query
- description: The timetoken used in the subscribe loop
- required: true
- style: form
- explode: true
- schema:
- type: integer
- - name: uuid
- in: query
- description: A unique alphanumeric ID for identifying the client to the PubNub
- Presence System, as well as for PubNub Analytics.
- style: form
- explode: true
- schema:
- type: string
- - name: auth
- in: query
- description: If the channel is protected by PAM, auth must be passed with
- a key which is authorized to publish to the channel.
- style: form
- explode: true
- schema:
- type: string
- - name: meta
- in: query
- description: Optional meta field
- style: form
- explode: true
- schema:
- type: object
- responses:
- 200:
- $ref: '#/components/responses/SuccessSubscribe'
- 400:
- $ref: '#/components/responses/BadRequest'
- 403:
- $ref: '#/components/responses/Forbidden'
- 429:
- $ref: '#/components/responses/RateLimited'
- components:
- responses:
- SuccessSubscribe:
- description: Success
- content:
- 'text/javascript':
- schema:
- $ref: '#/components/schemas/SuccessSubscribeResponse'
- example:
- t:
- t: '15632909833085074'
- r: 1
- m:
- - p:
- t: '15632909833114637'
- r: 1
- k: demo
- c: test
- d: ping
- e: 1
- Success:
- description: Success
- content:
- 'text/javascript':
- schema:
- $ref: '#/components/schemas/SuccessResponse'
- example:
- - 1
- - Sent
- - '15614849564528142'
- BadRequest:
- description: There was an error with the request
- content:
- 'text/javascript':
- schema:
- oneOf:
- - $ref: '#/components/schemas/BadRequestResponse'
- - $ref: '#/components/schemas/InvalidJSONResponse'
- - $ref: '#/components/schemas/MessageTooLargeResponse'
- example:
- message: Invalid Subscribe Key
- error: true
- service: Access Manager
- status: 400
- Forbidden:
- description: Client is not authorized to perform this operation.
- content:
- 'text/javascript':
- schema:
- $ref: '#/components/schemas/ForbiddenResponse'
- example:
- message: Forbidden
- payload:
- channels:
- - channel
- error: true
- service: Access Manager
- status: 403
- NotFound:
- description: Requested object was not found.
- content:
- 'text/javascript':
- schema:
- $ref: '#/components/schemas/NotFoundResponse'
- example: []
- TooLargeBody:
- description: The Signal POST body is larger than 32KB
- content:
- 'text/javascript':
- schema:
- $ref: '#/components/schemas/TooLargeBodyResponse'
- example:
- status: 413
- service: Balancer
- error: true
- message: Request Entity Too Large
- RateLimited:
- description: The Signal POST body is larger than 32KB
- content:
- 'text/javascript':
- schema:
- $ref: '#/components/schemas/RateLimitedResponse'
- example:
- status: 429
- error: true
- message: Too many requests.
- schemas:
- SuccessSubscribeResponse:
- type: object
- properties:
- t:
- type: object
- description: The timetoken and region object
- m:
- type: array
- items:
- type: object
- description: An individual message envelope
- properties:
- a:
- type: string
- description: The shard ID
- f:
- type: integer
- description: A bitmap representing debugflags
- i:
- type: string
- description: Client UUID
- s:
- type: integer
- description: Sequence Number
- p:
- type: object
- description: The object of publish timetoken and region
- properties:
- t:
- type: integer
- description: Publish timetoken
- r:
- type: string
- description: The region
- o:
- type: object
- description: The object of origin timetoken and region
- properties:
- t:
- type: integer
- description: Timetoken issued by client originating the message
- r:
- type: string
- description: The region
- c:
- type: string
- description: The channel subscribed too
- k:
- type: string
- description: The subscribe key
- d:
- type: object
- description: The message payload
- e:
- type: integer
- description: A bitmap representing the message type. 0 or not present is a normal publish. 1 is a signal.
- u:
- type: object
- description: User Metadata
- description: The array of message objects
- SuccessResponse:
- type: object
- properties:
- 1:
- type: integer
- description: A constant 1
- Sent:
- type: string
- description: A constant "Sent"
- Timetoken:
- type: number
- description: A 17 digit timetoken defined since the epoch. It represents when the Signal happened.
- BadRequestResponse:
- type: object
- properties:
- message:
- type: string
- description: A description of the error
- error:
- type: boolean
- description: The boolean true as an error occured
- service:
- type: string
- description: The service which rejected the request
- status:
- type: integer
- description: The status code returned in the response header duplicated in the body
- InvalidJSONResponse:
- type: object
- properties:
- 0:
- type: integer
- description: A constant 0
- Invalid JSON:
- type: string
- description: A constant "Invalid JSON"
- Timetoken:
- type: number
- description: A 17 digit timetoken defined since the epoch. It represents when the Signal was attempted.
- MessageTooLargeResponse:
- type: object
- properties:
- 0:
- type: integer
- description: A constant 0
- Signal size too large:
- type: string
- description: A constant "Signal size too large"
- Timetoken:
- type: number
- description: A 17 digit timetoken defined since the epoch. It represents when the Signal was attempted.
- ForbiddenResponse:
- type: object
- properties:
- message:
- type: string
- description: A description of the error
- payload:
- type: object
- description: The resources that were requested and forbidden
- error:
- type: boolean
- description: The boolean true as an error occured
- service:
- type: string
- description: The service which rejected the request
- status:
- type: integer
- description: The status code returned in the response header duplicated in the body
- NotFoundResponse:
- type: array
- description: An empty array
- TooLargeBodyResponse:
- type: object
- properties:
- message:
- type: string
- description: A description of the error
- error:
- type: boolean
- description: The boolean true as an error occured
- service:
- type: string
- description: The service which rejected the request
- status:
- type: integer
- description: The status code returned in the response header duplicated in the body
- RateLimitedResponse:
- type: object
- properties:
- message:
- type: string
- description: A description of the error
- error:
- type: boolean
- description: The boolean true as an error occured
- status:
- type: integer
- description: The status code returned in the response header duplicated in the body
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement