{"openapi":"3.0.0","info":{"description":"REST API for HU which covers these senarios,\n- Delivery of ad information as determined by the server\n- Notification of display of ad infomation by HU\n- Notification of vehicle arrival and leave events","version":"1.0.0","title":"A2VP HU API"},"servers":[{"description":"SwaggerHub API Auto Mocking","url":"https://virtserver.swaggerhub.com/jtachikawa/a2vp-hu-api/1.0.0"}],"tags":[{"name":"Brand"},{"name":"POI"},{"name":"Advertisement"},{"name":"Vehicle"},{"name":"Debug"}],"security":[{"api_key":[]}],"paths":{"/brands":{"get":{"tags":["Brand"],"summary":"1. 広告ブランド情報の取得(複)","description":"関連付けられた広告ブランド情報を返す\n","responses":{"200":{"description":"results of get brands","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BrandItem"}}}}},"401":{"description":"Wrong API key"}}}},"/brands/{brandId}":{"get":{"tags":["Brand"],"summary":"2. 広告ブランド報取得(単)","description":"brandIdで示される広告ブランド情報を返す\n","parameters":[{"in":"path","name":"brandId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"results of get brands","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrandItem"}}}},"401":{"description":"Wrong API key"},"404":{"description":"No brand with the brandId."}}}},"/POIs":{"get":{"tags":["POI"],"summary":"3. POI情報の取得(複)","description":"距離範囲とbrandIdのいずれか（または両方）で、限定されるPOI情報を返す。\n","parameters":[{"in":"query","name":"lat","description":"latitude","schema":{"type":"number"}},{"in":"query","name":"lng","description":"longitude","schema":{"type":"number"}},{"in":"query","name":"radius","description":"radius (meter)","schema":{"type":"number"}},{"in":"query","name":"brandIds","description":"camma separated list of brandIds","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":false}],"responses":{"200":{"description":"results of get POIs","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/POIItem"}}}}},"401":{"description":"Wrong API key"}}}},"/POIs/{poiId}":{"get":{"tags":["POI"],"summary":"4. POI情報の取得(単)","description":"poiIdで示されるPOI情報を返す\n","parameters":[{"in":"path","name":"poiId","description":"POI id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"result of get POI","content":{"application/json":{"schema":{"$ref":"#/components/schemas/POIItem"}}}},"404":{"description":"No POI with the poiId."}}}},"/advertisement/here":{"post":{"deprecated":true,"tags":["Advertisement"],"summary":"5. 現在値における広告情報の取得(単)","parameters":[{"in":"query","name":"lat","description":"latitude","required":true,"schema":{"type":"number"}},{"in":"query","name":"lng","description":"longitude","required":true,"schema":{"type":"number"}}],"responses":{"200":{"description":"the ad for this location which determined by the server","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdItem"}}}},"400":{"description":"bad input parameter"}}}},"/advertisement/route":{"post":{"deprecated":true,"tags":["Advertisement"],"summary":"6. 経路情報を考慮した広告情報の取得(単)","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdRequest"}}},"description":"route infomation, only LineString format of GeoJSON (https://ja.wikipedia.org/wiki/GeoJSON) is supported."},"responses":{"200":{"description":"the ad for the route which determined by the server","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdItem"}}}},"400":{"description":"bad input parameter"}}}},"/advertisement/histories":{"post":{"deprecated":true,"tags":["Advertisement"],"summary":"8. 表示履歴からの広告情報の取得(複)","parameters":[{"in":"query","name":"time","required":true,"description":"elapsed time (milliseconds)","schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"List of ads which were notified to be viewed in the past","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AdItem"}}}}},"400":{"description":"bad input parameter"}}}},"/advertisements":{"post":{"tags":["Advertisement"],"summary":"10. 広告情報の取得(複)","description":"リクエストボディの内容（現在地の広告、経路情報に基づく広告、表示履歴に基づく広告）が示す、広告情報を返す。","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdRequest"}}},"description":"広告の種類（現在値、経路情報、視聴履歴）、および各種類における値（位置情報、経過時間）"},"responses":{"200":{"description":"the ad for the route which determined by the server","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AdItem"}}}}},"400":{"description":"bad input parameter"},"401":{"description":"Wrong API key"}}},"get":{"tags":["Debug"],"summary":"広告情報取得, ordered by 'updated'","parameters":[{"in":"query","name":"limit","required":false,"description":"max items to be returned. default: 100","schema":{"type":"integer","format":"int32"}},{"in":"query","name":"after","required":false,"description":"Specify start date for paging.","schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"results of get Advertisements","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdItem"}}}},"401":{"description":"Wrong API key"}}}},"/advertisements/{adId}/show":{"post":{"tags":["Advertisement"],"summary":"7. 広告情報視聴の開始通知","description":"HUにおける広告の表示をサーバに通知する\n","parameters":[{"in":"path","name":"adId","required":true,"schema":{"type":"string"}},{"in":"query","name":"lat","required":true,"schema":{"type":"number"}},{"in":"query","name":"lng","required":true,"schema":{"type":"number"}}],"responses":{"200":{"description":"ok"},"401":{"description":"Wrong API key"},"404":{"description":"No Advertisement with the adId"}}}},"/advertisements/{adId}/hide":{"post":{"tags":["Advertisement"],"summary":"7. 広告情報視聴の終了通知","description":"HUにおける広告の非表示（次の広告への遷移を含む）をサーバに通知する\n","parameters":[{"in":"path","name":"adId","required":true,"schema":{"type":"string"}},{"in":"query","name":"reason","required":true,"description":"Notify the server that the ad has stopped to be displayed and its reason\n  * `complete` - The requested display time has been satisfied.\n  * `close` - The display was interrupted by a user operation.\n  * `leave` - The other reason (vehicle began to moves, screen transition by other user operation, ...)\n","schema":{"type":"string","enum":["complete","close","leave"]}},{"in":"query","name":"lat","required":true,"schema":{"type":"number"}},{"in":"query","name":"lng","required":true,"schema":{"type":"number"}}],"responses":{"200":{"description":"ok"},"401":{"description":"Wrong API key"},"404":{"description":"No Advertisement with the adId"}}}},"/advertisements/{adId}/sendmail":{"post":{"tags":["Advertisement"],"summary":"Share ad or coupon via e-mail","description":"Send an e-mail to the driver's address including the specified ad or coupon\n","parameters":[{"in":"path","name":"adId","description":"ID of the ad or coupon to include in the e-mail","required":true,"schema":{"type":"string"}},{"in":"query","name":"lat","required":true,"schema":{"type":"number"}},{"in":"query","name":"lng","required":true,"schema":{"type":"number"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMailRequest"}}},"description":"additional information which may be required to send an e-mail to the driver"},"responses":{"204":{"description":"ok"},"400":{"description":"Required parameter(s) missing"},"401":{"description":"Wrong API key"},"500":{"description":"Failed to send a mail (including when driver's e-mail address is unknown)"}}}},"/advertisements/{adId}":{"get":{"tags":["Debug"],"summary":"広告情報取得","parameters":[{"in":"path","name":"adId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"results of get Advertisements","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdItem"}}}},"401":{"description":"Wrong API key"},"404":{"description":"No Advertisement with the adId"}}}},"/vehicleevent":{"post":{"tags":["Vehicle"],"summary":"9. 車両イベントの通知","description":"車両の動作（発車、停車）をサーバに通知する\n","parameters":[{"in":"query","name":"lat","required":true,"schema":{"type":"number"}},{"in":"query","name":"lng","required":true,"schema":{"type":"number"}},{"in":"query","name":"event","required":true,"schema":{"type":"string","enum":["leave","arrive"]},"description":"vehicle event type\n - `leave` - began to move\n - `arrive` - arrived at the destination or just stopped\n"}],"responses":{"200":{"description":"ok"},"400":{"description":"Invalid query parameters"},"401":{"description":"Wrong API key"}}}}},"components":{"securitySchemes":{"api_key":{"type":"apiKey","name":"x-driver-id","in":"header"}},"schemas":{"BrandItem":{"type":"object","required":["brandId","iconUrl"],"properties":{"brandId":{"type":"string","example":"xxx"},"iconUrl":{"type":"string","example":"https://firebasestorage.googleapis.com/v0/b/a2vp-dev.appspot.com/o/icons%2FIYwRFJOaG7YUk0XASfQh?alt=media&token=f3e8a80b-a25e-4e58-bf8d-64035571545a"},"name":{"type":"string","example":"Advertiser Name"}}},"POIItem":{"type":"object","required":["poiId","brandId","name","lat","lng"],"properties":{"poiId":{"type":"string","example":"xxx"},"brandId":{"type":"string","example":"yyy"},"name":{"type":"string","example":"A POI"},"address":{"type":"string","example":"Tokyo"},"tel":{"type":"string"},"lat":{"type":"number"},"lng":{"type":"number"}}},"GeoJsonObject":{"description":"GeoJSon object\nThe coordinate reference system for all GeoJSON coordinates is a geographic coordinate reference system, using the World Geodetic System 1984 (WGS 84) datum, with longitude and latitude units of decimal degrees. This is equivalent to the coordinate reference system identified by the Open Geospatial Consortium (OGC) URN An OPTIONAL third-position element SHALL be the height in meters above or below the WGS 84 reference ellipsoid. In the absence of elevation values, applications sensitive to height or depth SHOULD interpret positions as being at local ground or sea level.\n","externalDocs":{"url":"https://tools.ietf.org/html/rfc7946#section-3"},"type":"object","properties":{"type":{"type":"string","enum":["Feature","FeatureCollection","Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon","GeometryCollection"]}},"required":["type"],"discriminator":{"propertyName":"type"}},"Geometry":{"description":"Abstract type for all GeoJSon object except Feature and FeatureCollection\n","externalDocs":{"url":"https://tools.ietf.org/html/rfc7946#section-3"},"allOf":[{"$ref":"#/components/schemas/GeoJsonObject"},{"type":"object","properties":{"type":{"type":"string","enum":["Point","LineString"]}},"required":["type"],"discriminator":{"propertyName":"type"}}]},"GeometryElement":{"description":"Abstract type for all GeoJSon 'Geometry' object the type of which is not 'GeometryCollection'\n","externalDocs":{"url":"https://tools.ietf.org/html/rfc7946#section-3"},"allOf":[{"$ref":"#/components/schemas/Geometry"},{"type":"object","properties":{"type":{"type":"string","enum":["Point","LineString"]}},"required":["type"],"discriminator":{"propertyName":"type"}}]},"Feature":{"description":"GeoJSon 'Feature' object","externalDocs":{"url":"https://tools.ietf.org/html/rfc7946#section-3.2"},"allOf":[{"$ref":"#/components/schemas/GeoJsonObject"},{"type":"object","required":["geometry","properties"],"properties":{"geometry":{"allOf":[{"nullable":true},{"$ref":"#/components/schemas/Geometry"}]},"properties":{"type":"object","nullable":true}}}]},"Position":{"description":"GeoJSon fundamental geometry construct.\nA position is an array of numbers. There MUST be two or more elements. The first two elements are longitude and latitude, or easting and northing, precisely in that order and using decimal numbers. Altitude or elevation MAY be included as an optional third element.\nImplementations SHOULD NOT extend positions beyond three elements because the semantics of extra elements are unspecified and ambiguous. Historically, some implementations have used a fourth element to carry a linear referencing measure (sometimes denoted as \"M\") or a numerical timestamp, but in most situations a parser will not be able to properly interpret these values. The interpretation and meaning of additional elements is beyond the scope of this specification, and additional elements MAY be ignored by parsers.\n","externalDocs":{"url":"https://tools.ietf.org/html/rfc7946#section-3.1.1"},"type":"array","minItems":2,"maxItems":3,"items":{"type":"number"},"example":[139.7671248,35.68123620000001]},"LineStringCoordinates":{"description":"GeoJSon fundamental geometry construct, array of two or more positions.\n","externalDocs":{"url":"https://tools.ietf.org/html/rfc7946#section-3.1.4"},"type":"array","items":{"$ref":"#/components/schemas/Position"},"minItems":2,"example":[[139.7671248,35.68123620000001],[139.76347699573972,35.67794368357555],[139.7697962801788,35.67617449450746]]},"Point":{"description":"GeoJSon geometry","externalDocs":{"url":"https://tools.ietf.org/html/rfc7946#section-3.1.2"},"allOf":[{"$ref":"#/components/schemas/GeometryElement"},{"type":"object","required":["type","coordinates"],"properties":{"type":{"type":"string","enum":["Point"]},"coordinates":{"$ref":"#/components/schemas/Position"}}}]},"LineString":{"description":"GeoJSon geometry","externalDocs":{"url":"https://tools.ietf.org/html/rfc7946#section-3.1.4"},"allOf":[{"$ref":"#/components/schemas/GeometryElement"},{"type":"object","required":["coordinates"],"properties":{"coordinates":{"$ref":"#/components/schemas/LineStringCoordinates"}}}]},"PointFeature":{"description":"GeoJSon 'Feature' object that has a Point","externalDocs":{"url":"https://tools.ietf.org/html/rfc7946#section-3.2"},"allOf":[{"$ref":"#/components/schemas/GeoJsonObject"},{"type":"object","required":["geometry","properties"],"properties":{"geometry":{"allOf":[{"nullable":true},{"$ref":"#/components/schemas/Point"}]},"properties":{"type":"object","nullable":true}}}]},"LineStringFeature":{"description":"GeoJSon 'Feature' object that has a LineString","externalDocs":{"url":"https://tools.ietf.org/html/rfc7946#section-3.2"},"allOf":[{"$ref":"#/components/schemas/GeoJsonObject"},{"type":"object","required":["geometry","properties"],"properties":{"geometry":{"allOf":[{"nullable":true},{"$ref":"#/components/schemas/LineString"}]},"properties":{"type":"object","nullable":true}}}]},"HereAdRequest":{"type":"object","required":["type","geo"],"properties":{"type":{"type":"string","enum":["here"]},"geo":{"$ref":"#/components/schemas/PointFeature"}}},"RouteAdRequest":{"type":"object","required":["type","geo"],"properties":{"type":{"type":"string","enum":["route"]},"geo":{"$ref":"#/components/schemas/LineStringFeature"}}},"HistoryAdRequest":{"type":"object","required":["type","time"],"properties":{"type":{"type":"string","enum":["history"]},"time":{"type":"number","description":"milliseconds"}}},"AdRequest":{"oneOf":[{"$ref":"#/components/schemas/HereAdRequest"},{"$ref":"#/components/schemas/RouteAdRequest"},{"$ref":"#/components/schemas/HistoryAdRequest"}],"discriminator":{"propertyName":"type","mapping":{"here":"#/components/schemas/HereAdRequest","route":"#/components/schemas/RouteAdRequest","history":"#/components/schemas/HistoryAdRequest"}}},"AdItem":{"type":"object","required":["adId","brandId","contents","poiIds","updated","duration"],"properties":{"adId":{"type":"string","example":"abdef"},"brandId":{"type":"string","example":"xyz"},"contents":{"type":"array","items":{"$ref":"#/components/schemas/Content"}},"poiIds":{"type":"array","items":{"type":"string"},"example":["poi-0","poi-1","poi-2"]},"updated":{"type":"string","format":"date"},"duration":{"type":"integer","format":"int32","description":"milliseconds","example":5000}}},"ImageContent":{"type":"object","required":["type","url","coupon"],"properties":{"type":{"type":"string","enum":["image"]},"url":{"type":"string","format":"url","example":"https://firebasestorage.googleapis.com/v0/b/a2vp-dev.appspot.com/o/images%2FTDP7nVFrFk4Qqfo2VQGb?alt=media&token=827f7443-f3cf-4687-99bf-a3c48065b629"},"coupon":{"type":"boolean","example":true}}},"SoundContent":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["sound"]}}},"VideoContent":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["video"]}}},"Content":{"oneOf":[{"$ref":"#/components/schemas/ImageContent"},{"$ref":"#/components/schemas/SoundContent"},{"$ref":"#/components/schemas/VideoContent"}],"discriminator":{"propertyName":"type","mapping":{"image":"#/components/schemas/ImageContent","sound":"#/components/schemas/SoundContent","video":"#/components/schemas/VideoContent"}}},"SendMailRequest":{"type":"object","properties":{"emailAddress":{"type":"string","description":"A destination e-mail address"}}}}}}