{"swagger":"2.0","info":{"title":"OwnLocal API","version":"v1"},"securityDefinitions":{"apiKey":{"type":"apiKey","name":"Authorization","in":"header"}},"definitions":{"ad":{"type":"object","properties":{"adUuid":{"type":"string","example":"795d064b-1810-4f6b-bada-6a9f7d534579","format":"uuid"},"fileName":{"type":"string","example":"{original_filename}.pdf","format":"uuid"},"adCustomId":{"type":"string","example":"234567"},"businessUuid":{"type":"string","example":"2db5e240-c098-4d59-b3a3-bc7b7abc2c4c","format":"uuid"},"publisherUuid":{"type":"string","example":"2db5e240-c098-4d59-b3a3-bc7b7abc2c4c","format":"uuid"},"image":{"type":"string","example":"https://assets.ownlocal.com/ads/795d064b-1810-4f6b-bada-6a9f7d534579/order_image.jpeg"},"startDate":{"type":"string","example":"2019-09-01","format":"date"},"endDate":{"type":"string","example":"2019-09-30","format":"date"},"dateModified":{"type":"string","example":"2019-09-03","format":"date"},"dateCreated":{"type":"string","example":"2019-09-03","format":"date"},"adText":{"type":"string"},"offerCount":{"type":"integer","example":"4","format":"int64"},"offers":{"type":"array","items":{"$ref":"#/definitions/offer"},"example":[{"offerUuid":"bbfdc747-b2c9-4232-be7a-81dbf5290af4","offerImage":"https://ownlocal.imgix.net/offers/bbfdc747-b2c9-4232-be7a-81dbf5290af4.png","title":"40% Off Full Interior Detail Package","description":"","originalPrice":"","discountPercentage":"","discountPrice":"","discountOff":"","newPrice":"","bogo":false,"free":false,"validThrough":"","gtin8":[{"class":77015300},{"class":77015301}]},{"offerUuid":"5faaff6a-5ad9-4fcf-b68d-a025b1badd29","offerImage":"https://ownlocal.imgix.net/offers/5faaff6a-5ad9-4fcf-b68d-a025b1badd29.png","title":"Free Brake Inspection with Every Oil Change","description":"","originalPrice":"","discountPercentage":"","discountPrice":"","discountOff":"","newPrice":"","bogo":false,"free":false,"validThrough":"","gtin8":[{"class":77015300},{"class":77015301}]},{"offerUuid":"2df8c96b-f565-4c77-b776-8b02a9a92d30","offerImage":"https://ownlocal.imgix.net/offers/2df8c96b-f565-4c77-b776-8b02a9a92d30.png","title":"20% Off Full Vehicle Tint","description":"","originalPrice":"","discountPercentage":"","discountPrice":"","discountOff":"","newPrice":"","bogo":false,"free":false,"validThrough":"","gtin8":[{"class":77011700},{"class":77011701}]},{"offerUuid":"fea2a6e0-7993-460a-9a54-88acf6dc479b","offerImage":"https://ownlocal.imgix.net/offers/fea2a6e0-7993-460a-9a54-88acf6dc479b.png","title":"$150 Off Windshield Replacement (when going through Insurance)","description":"","originalPrice":"","discountPercentage":"","discountPrice":"","discountOff":"","newPrice":"","bogo":false,"free":false,"validThrough":"","gtin8":[{"class":77011300},{"class":77011301}]}]}},"required":["adUuid","businessUuid","publisherUuid","startDate","endDate","dateModified","dateCreated"]},"offer":{"type":"object","properties":{"offerUuid":{"type":"string","example":"bbfdc747-b2c9-4232-be7a-81dbf5290af4","format":"uuid"},"offerImage":{"type":"string","example":"https://ownlocal.imgix.net/offers/bbfdc747-b2c9-4232-be7a-81dbf5290af4.png"},"title":{"type":"string","example":"40% Off Full Interior Detail Package"},"description":{"type":"string"},"originalPrice":{"type":"string"},"discountPercentage":{"type":"string","example":"40"},"discountPrice":{"type":"string"},"discountOff":{"type":"string"},"newPrice":{"type":"string"},"bogo":{"type":"boolean","example":"false"},"free":{"type":"boolean","example":"false"},"validThrough":{"type":"string"},"gtin8":{"type":"array","items":{"type":"object","properties":{"class":{"type":"integer","format":"int64"}}}}},"required":["offerUuid","offerImage","title"]},"business":{"type":"object","properties":{"businessUuid":{"type":"string","example":"69271d95-e891-4bf7-a9ba-ce249e36e236","format":"uuid"},"businessCustomId":{"type":"string","example":"23456"},"publisherUuids":{"type":"array","items":{"type":"string"},"example":["e94df8d7-cc45-4ec9-b9fa-e42f04f74c38","9103093d-596a-4ed4-a0ea-d7a5bfc35912"]},"name":{"type":"string","example":"Cielo Azul Mexican Grill"},"logoUrl":{"type":"string","example":"http://www.cielobluemexreservations.com/CieloBlueMexicanGrill_logo.jpg"},"website":{"type":"string","example":"http://www.cielobluecantina.com"},"urls":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"label":{"type":"string"}},"example":{"url":"http://www.ciellobluemexreservations.com","laber":"Reservations"}}},"description":{"type":"string","example":"We provide our customers with a fun and happy environment along with our enthusiastic staff, always making sure our customers have the greatest time in our restaurants. We try to make everyone of our customers feel welcome, and to make them have a great experience with us."},"email":{"type":"string","example":"generalmgr@cielobluecantina.com"},"openingHours":{"type":"string","example":"Mo,Tu,We,Th,Fr 09:00-12:00"},"hoursGeneralDescription":{"type":"string","example":"Open 6 days a week, Tuesday to Sunday"},"conditionsOfAccess":{"type":"string","example":"reservations accepted"},"locations":{"type":"array","items":{"type":"object","properties":{"streetAddress":{"type":"integer","example":"197 Bloor St E"},"addressLocality":{"type":"string","example":"Oshawa"},"addressRegion":{"type":"string","example":"ON"},"postalCode":{"type":"string","example":"L1H 3M3"},"telephones":{"type":"array","items":{"type":"string"},"example":["905-720-2326"]}}}},"categories":{"type":"array","items":{"type":"string","example":"Food and Beverage"}},"subCategories":{"type":"array","items":{"type":"string","example":"Mexican Food"}},"social":{"type":"object","properties":{"facebookUrl":{"type":"instring","example":"https://www.facebook.com/CieloBlueBelmont/"},"instagramUrl":{"type":"string","example":"https://www.instagram.com/CieloBlueBelmont/"},"twitterUrl":{"type":"string","example":"https://www.twitter.com/CieloBlueBelmont/"},"youtubeUrl":{"type":"string","example":"https://www.youtube.com/CieloBlueBelmont/"},"yelpUrl":{"type":"string","example":"https://www.yelp.com/biz/Cielo-Blue-Belmont"}}},"acceptedPaymentMethods":{"type":"array","items":{"type":"string"},"example":["MasterCard","Cash"]},"images":{"type":"array","items":{"type":"string"},"example":["https://assets.ownlocal.com/images/a78feabb-df16-4fde-87aa-fba233d71671.jpeg","https://assets.ownlocal.com/images/bbfe0e1f-0d8a-40df-86bd-c6a2250c09ec.jpeg"]}},"required":[]},"category":{"type":"object","properties":{"title":{"type":"string","example":"Communication"},"subCategories":{"type":"array","items":{"type":"string"},"example":["Broadcasting Services","Cable TV","Newspapers and Magazines","Other","Publishing","Radio Stations","Telecommunications","TV Stations"]}}},"unacceptableContent":{"type":"object","properties":{"message":{"type":"string","example":"A message indicating why the content was unacceptable"}}},"ad_report":{"type":"object","properties":{"id":{"type":"string","example":"bbfdc747-b2c9-4232-be7a-81dbf5290af4","format":"uuid"},"start_date":{"type":"string","format":"date","example":"2020-01-01"},"end_date":{"type":"string","format":"date","example":"2020-21-01"},"online_impressions":{"type":"integer","format":"int64","example":400},"interaction_total_clicks":{"type":"integer","format":"int64","example":9},"interaction_about_us_clicks":{"type":"integer","format":"int64","example":9},"interaction_contact_clicks":{"type":"integer","format":"int64","example":9},"interaction_expand_ad_unit_clicks":{"type":"integer","format":"int64","example":9},"interaction_print_ad_clicks":{"type":"integer","format":"int64","example":9},"interaction_website_clicks":{"type":"integer","format":"int64","example":9},"interaction_facebook_clicks":{"type":"integer","format":"int64","example":9},"interaction_twitter_clicks":{"type":"integer","format":"int64","example":9},"interaction_instagram_clicks":{"type":"integer","format":"int64","example":9},"interaction_yelp_clicks":{"type":"integer","format":"int64","example":9},"interaction_call_clicks":{"type":"integer","format":"int64","example":9},"interaction_directions_clicks":{"type":"integer","format":"int64","example":9},"interaction_contact_form_submits":{"type":"integer","format":"int64","example":9},"interaction_share":{"type":"integer","format":"int64","example":9}}},"ads_report":{"type":"object","properties":{"start_date":{"type":"string","example":"2020-06-01","format":"date"},"end_date":{"type":"string","example":"2020-07-01","format":"date"},"publisher_name":{"type":"string","example":"The Pub News","format":"string"},"publisher_id":{"type":"string","example":"2db5e240-c098-4d59-b3a3-bc7b7abc2c4c","format":"uuid"},"ads":{"type":"array","items":{"$ref":"#/definitions/ad_reach"},"example":[{"uuid":"87415afa-ac85-4f55-b869-c63532d02ffe","start_date":"2020-06-24","end_date":"2020-06-25","data":{"online_impressions":{"overall":11346},"interaction_breakdown":{"breakdowns":{"overall":{"total_clicks":9,"about_us_clicks":0,"contact_clicks":0,"expand_ad_unit_clicks":9,"print_ad_clicks":0,"website_clicks":0,"facebook_clicks":0,"twitter_clicks":0,"instagram_clicks":0,"yelp_clicks":0,"call_clicks":0,"directions_clicks":0,"contact_form_submits":0,"share":0}}}}},{"uuid":"a3c6f485-07b1-4241-9bc7-9945be77d0a5","data":{"online_impressions":{"overall":11410},"interaction_breakdown":{"breakdowns":{"overall":{"total_clicks":4,"about_us_clicks":0,"contact_clicks":0,"expand_ad_unit_clicks":4,"print_ad_clicks":0,"website_clicks":0,"facebook_clicks":0,"twitter_clicks":0,"instagram_clicks":0,"yelp_clicks":0,"call_clicks":0,"directions_clicks":0,"contact_form_submits":0,"share":0}}}}}]}}},"business_report":{"type":"object","properties":{"start_date":{"type":"string","example":"2020-06-01","format":"date"},"end_date":{"type":"string","example":"2020-07-01","format":"date"},"business_name":{"type":"string","example":"My Local Business","format":"string"},"business_id":{"type":"string","example":"2db5e240-c098-4d59-b3a3-bc7b7abc2c4c","format":"uuid"},"reach_report":{"type":"object","items":{"$ref":"#/definitions/business_reach"},"example":{"print_distribution":0,"online_impressions":{"overall":277160},"total_ads":13,"directory":{"days":31,"impressions":0},"origami":{"ads":9,"days":10,"impressions":{"overall":277160}},"interaction_breakdown":{"breakdowns":{"overall":{"total_clicks":209,"about_us_clicks":1,"contact_clicks":0,"expand_ad_unit_clicks":181,"print_ad_clicks":0,"website_clicks":19,"facebook_clicks":0,"twitter_clicks":0,"instagram_clicks":0,"yelp_clicks":0,"call_clicks":1,"directions_clicks":7,"contact_form_submits":0,"share":0}}}}}}}},"paths":{"/api/v1/ads":{"post":{"summary":"Creates a new ad","tags":["Ads"],"consumes":["application/json"],"security":[{"apiKey":[]}],"parameters":[{"name":"ad","in":"body","required":"true","description":"Ad to be created","schema":{"type":"object","properties":{"publisherUuid":{"type":"string","example":"7e6ffeb2-22f3-4869-b189-d202996814cf","format":"uuid"},"businessUuid":{"type":"string","example":"69271d95-e891-4bf7-a9ba-ce249e36e236","format":"uuid"},"adCustomId":{"type":"string","example":"234567"},"startDate":{"type":"string","example":"2019-08-23","format":"date"},"endDate":{"type":"string","example":"2019-09-23","format":"date"}},"required":["publisherUuid"]}}],"responses":{"201":{"description":"Ad was successfully created","schema":{"type":"object","properties":{"adUuid":{"type":"string","example":"25c4ae81-095e-4229-a56b-cb2f3ae08f1f","format":"uuid"},"status":{"type":"string","example":"Created"},"message":{"type":"string","example":"Your ad for {publisher name} was successfully created. Provide content for this ad at the url indicated in content_url."},"content_url":{"type":"string","example":"https://labs.ownlocal.com/products/datashift/v1/ads/25c4ae81-095e-4229-a56b-cb2f3ae08f1f/content"}}}},"405":{"description":"Invalid input"}}},"get":{"summary":"Retrieve a list of Ads","tags":["Ads"],"produces":["application/json"],"security":[{"apiKey":[]}],"parameters":[{"name":"categories","in":"query","type":"string","example":"foodAndBeverage"},{"name":"subCategories","in":"query","type":"string","example":"mexicanFood,restaurants"},{"name":"offerCountMin","in":"query","type":"integer","format":"int64","example":5},{"name":"offerCountMax","in":"query","type":"integer","format":"int64","example":7},{"name":"startDateMin","in":"query","type":"string","format":"date","example":"2019-09-01T12:34:00"},{"name":"startDateMax","in":"query","type":"string","format":"date","example":"2019-09-02T16:40:01"},{"name":"endDateMin","in":"query","type":"string","format":"date","example":"2019-09-29T20:21:00"},{"name":"endDateMax","in":"query","type":"string","format":"date","example":"2019-09-30T10:56:00"},{"name":"dateModifiedMin","in":"query","type":"string","format":"date","example":"2019-09-01T10:56:00"},{"name":"dateModifiedMax","in":"query","type":"string","format":"date","example":"2019-09-07T10:56:00"},{"name":"dateCreatedMin","in":"query","type":"string","format":"date","example":"2019-09-01T10:56:00"},{"name":"dateCreatedMax","in":"query","type":"string","format":"date","example":"2019-09-07T12:34:00"},{"name":"businessUuids","in":"query","type":"array","items":{"type":"string"},"example":["7f188b7b-7bc8-452e-9bb6-82bb3e13f4b1","d69b6855-7e24-47e1-96a0-11c55ca0e9a7"]},{"name":"publisherUuids","in":"query","type":"array","items":{"type":"string"},"example":["7f188b7b-7bc8-452e-9bb6-82bb3e13f4b1","d69b6855-7e24-47e1-96a0-11c55ca0e9a7"]},{"name":"sortedBy","in":"query","type":"string","example":"createdAt,updatedAt,startDate,endDate"},{"name":"page","in":"query","type":"integer","format":"int64","example":2},{"name":"size","in":"query","type":"integer","format":"int64","example":20}],"responses":{"200":{"description":"ads found","schema":{"type":"array","items":{"$ref":"#/definitions/ad"}}}}}},"/api/v1/ads/{adUuid}/content":{"post":{"summary":"Upload content for an Ad","tags":["Ads"],"consumes":["multipart/form-data"],"security":[{"apiKey":[]}],"parameters":[{"name":"adUuid","in":"path","type":"string","format":"uuid","required":true,"description":"UUID of ad to upload content for","example":"d17a5879-092e-40e8-acc4-8b04be5b91de"},{"name":"file","in":"formData","type":"file","required":"true","description":"PDF to be associated with ad"},{"name":"fileName","in":"formData","type":"string","required":"true","description":"Name of the file"}],"responses":{"202":{"description":"Content was successfully received"},"400":{"description":"Content could not be saved","schema":{"$ref":"#/definitions/unacceptableContent"}}}}},"/api/v1/ads/{adUuid}":{"get":{"summary":"Retrieves an ad","tags":["Ads"],"produces":["application/json"],"security":[{"apiKey":[]}],"parameters":[{"name":"adUuid","in":"path","type":"string","format":"uuid","required":true,"description":"UUID of the Ad requested","example":"d17a5879-092e-40e8-acc4-8b04be5b91de"}],"responses":{"200":{"description":"ad found","schema":{"$ref":"#/definitions/ad"}},"404":{"description":"Ad {ad_uuid} not found"}}},"patch":{"summary":"Updates an ad","tags":["Ads"],"consumes":["application/json"],"produces":["application/json"],"security":[{"apiKey":[]}],"parameters":[{"name":"adUuid","in":"path","type":"string","format":"uuid","required":true,"description":"UUID of the Ad to update","example":"d17a5879-092e-40e8-acc4-8b04be5b91de"},{"name":"ad","in":"body","required":"true","description":"Ad to be created","schema":{"$ref":"#/definitions/ad"}}],"responses":{"200":{"description":"ad updated successfully","schema":{"$ref":"#/definitions/ad"}},"400":{"description":"Unpermitted params: {invalid params}"}}}},"/api/v1/businesses":{"get":{"summary":"Retrieve a list of businesses","tags":["Businesses"],"produces":["application/json"],"security":[{"apiKey":[]}],"parameters":[{"name":"categories","in":"query","type":"string","example":"foodAndBeverage"},{"name":"subCategories","in":"query","type":"string","example":"mexicanFood,restaurants"},{"name":"dateModifiedMin","in":"query","type":"string","format":"date","example":"2019-09-01T10:56:00"},{"name":"dateModifiedMax","in":"query","type":"string","format":"date","example":"2019-09-07T10:56:00"},{"name":"dateCreatedMin","in":"query","type":"string","format":"date","example":"2019-09-01T10:56:00"},{"name":"dateCreatedMax","in":"query","type":"string","format":"date","example":"2019-09-07T12:34:00"},{"name":"publisherUuids","in":"query","type":"array","items":{"type":"string"},"example":["7f188b7b-7bc8-452e-9bb6-82bb3e13f4b1","d69b6855-7e24-47e1-96a0-11c55ca0e9a7"]},{"name":"sortedBy","in":"query","type":"string","example":"createdAt,updatedAt,startDate,endDate"},{"name":"page","in":"query","type":"integer","format":"int64","example":2},{"name":"size","in":"query","type":"integer","format":"int64","example":20}],"responses":{"200":{"description":"businesses found","schema":{"type":"array","items":{"$ref":"#/definitions/business"}}}}},"post":{"summary":"Create a new business","tags":["Businesses"],"consumes":["application/json"],"security":[{"apiKey":[]}],"parameters":[{"name":"business","in":"body","required":"true","description":"Business to be created","schema":{"$ref":"#/definitions/business"}}],"responses":{"201":{"description":"Business was successfully created","schema":{"type":"object","properties":{"businessUuid":{"type":"string","example":"25c4ae81-095e-4229-a56b-cb2f3ae08f1f","format":"uuid"},"status":{"type":"string","example":"Created"},"message":{"type":"string","example":"Your business {business name} was successfully created."}}}},"405":{"description":"Invalid input"}}}},"/api/v1/businesses/{businessUuid}":{"get":{"summary":"Retrieves a business","tags":["Businesses"],"produces":["application/json"],"security":[{"apiKey":[]}],"parameters":[{"name":"businessUuid","in":"path","type":"string","format":"uuid","required":true,"description":"UUID of the Business requested","example":"725f5b11-f3f0-42e8-88b7-0d46daa1a72d"}],"responses":{"200":{"description":"ad found","schema":{"$ref":"#/definitions/business"}},"404":{"description":"Business {business_uuid} not found"}}}},"/api/v1/businesses/{businessUuid}/images":{"post":{"summary":"Upload image for a business","tags":["Businesses"],"consumes":["multipart/form-data"],"security":[{"apiKey":[]}],"parameters":[{"name":"businessUuid","in":"path","type":"string","format":"uuid","required":true,"description":"UUID of business to upload image for","example":"25c4ae81-095e-4229-a56b-cb2f3ae08f1f"},{"name":"file","in":"formData","type":"file","required":"true","description":"Image to upload"},{"name":"fileName","in":"formData","type":"string","required":"true","description":"Name of the file"}],"responses":{"202":{"description":"Content was successfully received"},"400":{"description":"Content could not be saved","schema":{"$ref":"#/definitions/unacceptableContent"}}}}},"/api/v1/businesses/{businessUuid}/logo":{"post":{"summary":"Upload logo for a business","tags":["Businesses"],"consumes":["multipart/form-data"],"security":[{"apiKey":[]}],"parameters":[{"name":"businessUuid","in":"path","type":"string","format":"uuid","required":true,"description":"UUID of business to upload logo for","example":"25c4ae81-095e-4229-a56b-cb2f3ae08f1f"},{"name":"file","in":"formData","type":"file","required":"true","description":"Logo file to upload"},{"name":"fileName","in":"formData","type":"string","required":"true","description":"Name of the file"}],"responses":{"202":{"description":"Content was successfully received"},"400":{"description":"Content could not be saved","schema":{"$ref":"#/definitions/unacceptableContent"}}}}},"/api/v1/categories":{"get":{"summary":"Retrieve a list of categories","tags":["Categories"],"produces":["application/json"],"security":[{"apiKey":[]}],"parameters":[{"name":"sortedBy","in":"query","type":"string","example":"createdAt,updatedAt,startDate,endDate"},{"name":"page","in":"query","type":"integer","format":"int64","example":2},{"name":"size","in":"query","type":"integer","format":"int64","example":20}],"responses":{"200":{"description":"categories found","schema":{"type":"array","items":{"$ref":"#/definitions/category"}}}}}},"/api/v1/reports/ads":{"get":{"summary":"Builds and returns an ads report","tags":["Reports Data API"],"produces":["application/json"],"security":[{"apiKey":[]}],"parameters":[{"name":"publisher_id","in":"query","type":"string","example":"7f188b7b-7bc8-452e-9bb6-82bb3e13f4b1"},{"name":"start_date","in":"query","type":"string","example":"2020-02-01"},{"name":"end_date","in":"query","type":"string","example":"2020-02-02"}],"responses":{"200":{"description":"result ads report","schema":{"$ref":"#/definitions/ads_report"}}}}},"/api/v1/reports/business":{"get":{"summary":"Builds and returns a business report","tags":["Reports Data API"],"produces":["application/json"],"security":[{"apiKey":[]}],"parameters":[{"name":"publisher_id","in":"query","type":"string","example":"7f188b7b-7bc8-452e-9bb6-82bb3e13f4b1"},{"name":"business_id","in":"query","type":"string","example":"d69b6855-7e24-47e1-96a0-11c55ca0e9a7"},{"name":"start_date","in":"query","type":"string","example":"2020-02-01"},{"name":"end_date","in":"query","type":"string","example":"2020-02-02"}],"responses":{"200":{"description":"result business report","schema":{"$ref":"#/definitions/business_report"}}}}}}}