Skip to content

Instantly share code, notes, and snippets.

@DriveQuantPublic
Created May 22, 2024 09:43
Show Gist options
  • Save DriveQuantPublic/f9993ed846c18538b6d86a2fb8aba1c7 to your computer and use it in GitHub Desktop.
Save DriveQuantPublic/f9993ed846c18538b6d86a2fb8aba1c7 to your computer and use it in GitHub Desktop.
openapi: 3.0.0
info:
title: PushData
version: '1.0'
servers:
- url: 'https://my-api.example.com'
description: client server URL
paths:
/push/diagnostic/events:
post:
summary: 'Your push diagnostic events service'
operationId: post-push-diagnostic-events
responses:
'200':
description: Event successfully processed
'401':
description: Unauthorized to push events
parameters:
- schema:
type: string
in: header
name: Authorization
description: Authentication (preferably OAuth2 token)
requestBody:
content:
application/json:
schema:
type: object
description: "Push diagnostic events request"
properties:
userId:
type: string
description: User unique identifier
example: "john.doe@drivequant.com"
smartphoneData:
type: object
description: Data related to the user smartphone sending the request
properties:
phoneModel:
type: string
description: Device model name
example: "iPhone 15 Pro"
appBuildNumber:
type: string
description: Mobile app build number
example: "1032"
appVersion:
type: string
description: Version of the mobile app
osVersion:
type: string
description: Version of the operating system
example: "17.4.1"
osType:
type: string
description: 'Platform: iOS or Android'
example: "iOS"
sdkVersion:
type: string
description: Version of the DriveKit SDK
example: "2.1"
lastUpdate:
description: Date at which the data was sent by the DriveKit SDK
format: date-time
pattern: 'yyyy-MM-dd''T''HH:mm:ss.SSSZ'
example: '2024-05-20T10:00:00.000+0200'
permissions:
type: array
description: "Events related to the application’s permissions"
items:
type: object
properties:
date:
type: string
description: "Date of the event"
format: date-time
pattern: 'yyyy-MM-dd''T''HH:mm:ss.SSSZ'
example: '2024-05-20T10:00:00.000+0200'
type:
type: string
description: "Type of the event"
enum:
- LOCATION_ACCESS
- BLUETOOTH_ACCESS
- ACTIVITY_ACCESS
- NOTIFICATION_ACCESS
value:
type: string
description: "Value of the event"
enum:
- GRANTED
- DENIED
sensors:
type: array
description: "Events related to the smartphone’s sensors"
items:
type: object
properties:
date:
type: string
description: "Date of the event"
format: date-time
pattern: 'yyyy-MM-dd''T''HH:mm:ss.SSSZ'
example: '2024-05-20T10:00:00.000+0200'
type:
type: string
description: "Type of the event"
enum:
- GPS_SENSOR
- BLUETOOTH_SENSOR
value:
type: string
description: "Value of the event"
enum:
- ENABLED
- DISABLED
settings:
type: array
description: "Events related to the smartphone’s configuration"
items:
type: object
properties:
date:
type: string
description: "Date of the event"
format: date-time
pattern: 'yyyy-MM-dd''T''HH:mm:ss.SSSZ'
example: '2024-05-20T10:00:00.000+0200'
type:
type: string
enum:
- PERMISSIONS_AUTO_DELETE
- BATTERY_OPTIMISATION
- LOW_POWER_MODE
value:
type: string
description: "Value of the event"
enum:
- ENABLED
- DISABLED
events:
type: array
description: "Events related to user events"
items:
type: object
properties:
date:
type: string
description: "Date of the event"
format: date-time
pattern: 'yyyy-MM-dd''T''HH:mm:ss.SSSZ'
example: '2024-05-20T10:00:00.000+0200'
type:
type: string
description: "Type of the event"
enum:
- APP_STATE
- LOGIN_STATE
- PHONE_STATE
value:
type: string
description: "Value of the event"
enum:
- INSTALLED
- UNINSTALLED
- LOGGED_IN
- LOGGED_OUT
- TURNED_ON
- TURNED_OFF
required:
- userId
- smartphoneData
- permissions
- sensors
- settings
- events
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment