Skip to content

Instantly share code, notes, and snippets.

@tbarbugli
Last active January 8, 2020 13:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tbarbugli/f40c2815b64ca517745acdedceaa7e9b to your computer and use it in GitHub Desktop.
Save tbarbugli/f40c2815b64ca517745acdedceaa7e9b to your computer and use it in GitHub Desktop.
{
"openapi": "3.0.0",
"info": {
"description": "Stream Analytics API",
"version": "1.0.0",
"title": "Stream Analytics",
"contact": {
"email": "support@getstream.io"
}
},
"servers": [
{
"url": "https://analytics.stream-io-api.com/analytics/v1.0",
"description": "Analytics API endpoint"
}
],
"paths": {
"/impression/": {
"post": {
"summary": "Track one or more impressions",
"requestBody": {
"$ref": "#/components/requestBodies/Impression"
},
"responses": {
"201": {
"description": "Created"
},
"401": {
"$ref": "#/components/responses/UnauthorizedError"
}
},
"security": [
{
"apiKey": [],
"token": []
}
]
}
},
"/engagement/": {
"post": {
"summary": "Track a new engagement event",
"requestBody": {
"$ref": "#/components/requestBodies/Engagement"
},
"responses": {
"201": {
"description": "Created"
},
"401": {
"$ref": "#/components/responses/UnauthorizedError"
}
},
"security": [
{
"apiKey": [],
"token": []
}
]
}
}
},
"components": {
"responses": {
"UnauthorizedError": {
"description": "Access token is missing or invalid"
}
},
"securitySchemes": {
"apiKey": {
"type": "apiKey",
"in": "query",
"name": "api_key"
},
"token": {
"type": "apiKey",
"in": "header",
"name": "authorization"
}
},
"schemas": {
"UserData": {
"description": "additional data for the engagement event",
"type": "object",
"properties": {
"id": {
"type": "string"
}
}
},
"EventContent": {
"description": "additional data for the engagement event",
"type": "object",
"properties": {
"foreign_id": {
"type": "string",
"description": "the foreign_id of the tracked content",
"example": "post:123"
}
}
},
"Impression": {
"description": "A JSON object containing one or more impressions",
"type": "object",
"oneOf": [
{
"required": [
"content"
]
},
{
"required": [
"content_list"
]
}
],
"properties": {
"feed_id": {
"type": "string",
"description": "the id of the feed where the engagement was tracked",
"example": "user:123"
},
"user_data": {
"$ref": "#/components/schemas/UserData"
},
"location": {
"type": "string",
"description": "the location (ie. page) where the tracking was done"
},
"position": {
"type": "integer",
"description": "the position inside the feed of the activity"
},
"boost": {
"type": "number",
"description": "the boost factor for this engagement"
},
"content": {
"$ref": "#/components/schemas/EventContent"
},
"content_list": {
"type": "array",
"minItems": 1,
"maxItems": 100,
"items": {
"$ref": "#/components/schemas/EventContent"
}
}
}
},
"Engagement": {
"description": "A JSON object containing pet information",
"required": [
"feed_id",
"label"
],
"properties": {
"feed_id": {
"type": "string",
"description": "the id of the feed where the engagement was tracked",
"example": "user:123"
},
"label": {
"type": "string",
"description": "the type of engagement",
"example": "click"
},
"user_data": {
"$ref": "#/components/schemas/UserData"
},
"content": {
"$ref": "#/components/schemas/EventContent"
},
"location": {
"type": "string",
"description": "the location (ie. page) where the tracking was done"
},
"position": {
"type": "integer",
"description": "the position inside the feed of the activity"
},
"boost": {
"type": "number",
"description": "the boost factor for this engagement"
}
}
}
},
"requestBodies": {
"Impression": {
"description": "A JSON object containing impression data",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Impression"
}
}
}
},
"Engagement": {
"description": "A JSON object containing impression data",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Engagement"
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment