Skip to main content

Deeplink Decrypt Endpoint

About

The Deeplink OpenAPI specification provides a REST API for retrieving Deep Links.

 

Open API Specification

openapi: 3.0.0
servers:
  - url: https://api{environment}.rapidsos.com/v1/deeplink
    description: Sandbox environment for testing and developing configurations
    variables:
      environment:
        enum:
          - '-sandbox'
          - '-staging'
          - ''
        default: '-sandbox'
info:
  version: '1.0'
  title: DeepLink API
  termsOfService: 'https://rapidsos.com/terms-of-service'
  contact:
    email: support@rapidsos.com
  description: |
    REST API for decrypting Deeplink tokens
paths:
  /{application_name}/decrypt:
    post:
      tags:
        - Decrypt
      description: Decrypt and decode the secure token contents for an App Launch deeplink URL. The value of `application_name` must match the name of the application which was launched to generate the token.
      parameters:
        - in: path
          name: application_name
          required: true
          description: |
            ID of the application which was requested to launch from RapidSOS Portal
          schema:
            type: string
          example:
            nsion_web_map
      responses:
        '200':
          description: Secure token was successfully decrypted & decoded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenDecryptResponse'
        '400':
          description: Bad Request
        '401':
          description: Invalid authentication
        '403':
          description: Unauthorized
        '415':
          description: Unsupported Media-Type
        '429':
          description: Too Many Requests
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TokenDecryptRequest'

components:
  schemas:
    TokenDecryptRequest:
      type: object
      description: Deeplink Secure Token Decryption Request
      required:
        - token
      properties:
        token:
          type: string
          description: Encrypted token containing deeplink contents
          example: eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4R0NNIn0..McILMB3dYsNJSuhcDzQshA.OfX9H_mcUpHDeRM4IA.CcnTWqaqxNsjT4eCaUABSg
    TokenDecryptResponse:
      type: object
      description: |
        App Launch Deeplink Secure Token Decryption Response
        Note - parameters returned depend on the application that the token was encrypted for.
      properties:
        access_token:
          type: string
          description: Access token that can be used to Query LEI API for
            location data
          example: fNheXbQnF7iIXEandAu1
        query:
          type: string
          description: Identifier to be auto queried by iRP in URI format
          example: tel://15555555555
        bounding_box:
          type: object
          description: Coordinate bounding box of the agency's jurisdiction
          required:
            - top_left
            - bottom_right
          properties:
            top_left:
              $ref: '#/components/schemas/Coordinate'
            bottom_right:
              $ref: '#/components/schemas/Coordinate'
        ecc_account_id:
          type: string
          description: |
            RapidSOS unique identifier for the ECC launching the application.
          example:
            CA_954
        incident_location:
          $ref: '#/components/schemas/Location'
    Coordinate:
      type: object
      description: WGS84 Coordinate
      required:
        - latitude
        - longitude
      properties:
        latitude:
          type: number
          description: WGS84 coordinate latitude
          example: 71.234
        longitude:
          type: number
          description: WGSf84 coordinate longitude
          example: -123.34
    Location:
      type: object
      description: 911 Caller Location
      required:
        - latitude
        - longitude
        - uncertainty_radius
      properties:
        latitude:
          type: number
          description: WGS84 coordinate latitude
          example: 71.234
        longitude:
          type: number
          description: WGSf84 coordinate longitude
          example: -123.34
        uncertainty_radius:
          type: number
          description: Uncertainty radius of the location in meters
          example: 10.0
        location_time:
          type: number
          description: |
            UTC Millisecond timestamp of when the location was determined
          example: 1627001542000

 

About us

We build APIs that share data with first responders to help protect lives.