123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267 |
- {
- "asyncapi": "2.0.0",
- "info": {
- "title": "Shlink",
- "version": "2.0.0",
- "description": "Shlink, the self-hosted URL shortener",
- "license": {
- "name": "MIT",
- "url": "https://github.com/shlinkio/shlink/blob/develop/LICENSE"
- }
- },
- "defaultContentType": "application/json",
- "channels": {
- "http://shlink.io/new-visit": {
- "subscribe": {
- "summary": "Receive information about any new visit occurring on any short URL.",
- "operationId": "newVisit",
- "message": {
- "payload": {
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "shortUrl": {
- "$ref": "#/components/schemas/ShortUrl"
- },
- "visit": {
- "$ref": "#/components/schemas/Visit"
- }
- }
- }
- }
- }
- },
- "http://shlink.io/new-visit/{shortCode}": {
- "parameters": {
- "shortCode": {
- "description": "The short code of the short URL",
- "schema": {
- "type": "string"
- }
- }
- },
- "subscribe": {
- "summary": "Receive information about any new visit occurring on a specific short URL.",
- "operationId": "newShortUrlVisit",
- "message": {
- "payload": {
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "shortUrl": {
- "$ref": "#/components/schemas/ShortUrl"
- },
- "visit": {
- "$ref": "#/components/schemas/Visit"
- }
- }
- }
- }
- }
- },
- "http://shlink.io/new-orphan-visit": {
- "subscribe": {
- "summary": "Receive information about any new orphan visit.",
- "operationId": "newOrphanVisit",
- "message": {
- "payload": {
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "visit": {
- "$ref": "#/components/schemas/OrphanVisit"
- }
- }
- }
- }
- }
- }
- },
- "components": {
- "schemas": {
- "ShortUrl": {
- "type": "object",
- "properties": {
- "shortCode": {
- "type": "string",
- "description": "The short code for this short URL."
- },
- "shortUrl": {
- "type": "string",
- "description": "The short URL."
- },
- "longUrl": {
- "type": "string",
- "description": "The original long URL."
- },
- "dateCreated": {
- "type": "string",
- "format": "date-time",
- "description": "The date in which the short URL was created in ISO format."
- },
- "visitsCount": {
- "type": "integer",
- "description": "The number of visits that this short URL has recieved."
- },
- "tags": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "description": "A list of tags applied to this short URL"
- },
- "meta": {
- "$ref": "#/components/schemas/ShortUrlMeta"
- },
- "domain": {
- "type": "string",
- "description": "The domain in which the short URL was created. Null if it belongs to default domain."
- }
- },
- "example": {
- "shortCode": "12C18",
- "shortUrl": "https://doma.in/12C18",
- "longUrl": "https://store.steampowered.com",
- "dateCreated": "2016-08-21T20:34:16+02:00",
- "visitsCount": 328,
- "tags": [
- "games",
- "tech"
- ],
- "meta": {
- "validSince": "2017-01-21T00:00:00+02:00",
- "validUntil": null,
- "maxVisits": 100
- },
- "domain": "example.com"
- }
- },
- "ShortUrlMeta": {
- "type": "object",
- "required": [
- "validSince",
- "validUntil",
- "maxVisits"
- ],
- "properties": {
- "validSince": {
- "description": "The date (in ISO-8601 format) from which this short code will be valid",
- "type": "string",
- "nullable": true
- },
- "validUntil": {
- "description": "The date (in ISO-8601 format) until which this short code will be valid",
- "type": "string",
- "nullable": true
- },
- "maxVisits": {
- "description": "The maximum number of allowed visits for this short code",
- "type": "number",
- "nullable": true
- }
- }
- },
- "Visit": {
- "type": "object",
- "properties": {
- "referer": {
- "type": "string",
- "description": "The origin from which the visit was performed"
- },
- "date": {
- "type": "string",
- "format": "date-time",
- "description": "The date in which the visit was performed"
- },
- "userAgent": {
- "type": "string",
- "description": "The user agent from which the visit was performed"
- },
- "visitLocation": {
- "$ref": "#/components/schemas/VisitLocation"
- }
- },
- "example": {
- "referer": "https://t.co",
- "date": "2015-08-20T05:05:03+04:00",
- "userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36",
- "visitLocation": {
- "cityName": "Cupertino",
- "countryCode": "US",
- "countryName": "United States",
- "latitude": 37.3042,
- "longitude": -122.0946,
- "regionName": "California",
- "timezone": "America/Los_Angeles"
- }
- }
- },
- "OrphanVisit": {
- "allOf": [
- {"$ref": "#/components/schemas/Visit"},
- {
- "type": "object",
- "properties": {
- "visitedUrl": {
- "type": "string",
- "nullable": true,
- "description": "The originally visited URL that triggered the tracking of this visit"
- },
- "type": {
- "type": "string",
- "enum": [
- "invalid_short_url",
- "base_url",
- "regular_404"
- ],
- "description": "Tells the type of orphan visit"
- }
- }
- }
- ],
- "example": {
- "referer": "https://t.co",
- "date": "2015-08-20T05:05:03+04:00",
- "userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36",
- "visitLocation": {
- "cityName": "Cupertino",
- "countryCode": "US",
- "countryName": "United States",
- "latitude": 37.3042,
- "longitude": -122.0946,
- "regionName": "California",
- "timezone": "America/Los_Angeles"
- },
- "visitedUrl": "https://doma.in",
- "type": "base_url"
- }
- },
- "VisitLocation": {
- "type": "object",
- "properties": {
- "cityName": {
- "type": "string"
- },
- "countryCode": {
- "type": "string"
- },
- "countryName": {
- "type": "string"
- },
- "latitude": {
- "type": "number"
- },
- "longitude": {
- "type": "number"
- },
- "regionName": {
- "type": "string"
- },
- "timezone": {
- "type": "string"
- }
- }
- }
- }
- }
- }
|