NAV
shell

Introduction

Welcome to the OwnLocal API. You can use our API to access OwnLocal API endpoints.

You can view code examples in the dark area to the right.

Authentication

To authorize, use this code:

# With shell, you can just pass the correct header with each request
curl "api_endpoint_here" \
  -H "Authorization: <token>"

Make sure to replace <token> with your API key.

OwnLocal uses API keys to allow access to the API. Contact our support team to get your API key.

OwnLocal expects for the API key to be included in all API requests to the server in a header that looks like the following:

Authorization: <token>

Ads

Get All Ads

curl "https://admin.austin.ownlocal.com/api/v1/ads" \
  -H "Authorization: <token>"

The above command returns JSON structured like this:

[
  {
    "id": "f3e40418-3971-41da-ae8d-6171b2724246",
    "file_name": "783px-Test-Logo.svg.pdf",
    "custom_id": "",
    "business_id": "d0932ac1-7f84-4125-84e6-dfaca305bd2b",
    "publisher_id": "5ec5342e-7817-4151-8a4c-80b43cc8c024",
    "image": "https://storage.googleapis.com/ownlocal-adforge-production/ads/11492682/original_images.jpg",
    "start_date": "2020-10-22",
    "end_date": "2020-11-21",
    "date_modified": "2020-12-08",
    "date_created": "2020-10-22",
    "text": "test\n test",
    "origami_background_image": null
  },
  {
    "id": "b13895cb-610d-4f6f-8cef-621f903c80f4",
    "file_name": "783px-Test-Logo.svg.pdf",
    "custom_id": "",
    "business_id": "d0932ac1-7f84-4125-84e6-dfaca305bd2b",
    "publisher_id": "5ec5342e-7817-4151-8a4c-80b43cc8c024",
    "image": "https://storage.googleapis.com/ownlocal-adforge-production/ads/11493952/original_images.jpg",
    "start_date": "2020-10-23",
    "end_date": "2020-11-22",
    "date_modified": "2020-12-08",
    "date_created": "2020-10-23",
    "text": "test\n test",
    "origami_background_image": null
  },
  ...
]

This endpoint retrieves all ads.

HTTP Request

GET https://admin.austin.ownlocal.com/api/v1/ads

Body Parameters

Parameter Type Description
categories string OPTIONAL Lists ads from business belonging to those categories, comma separated
sub_categories string OPTIONAL Lists ads from business belonging to those sub categories, comma separated
start_date_min date OPTIONAL Lists ads with start date after or equal to the provided value
start_date_max date OPTIONAL Lists ads with start date before or equal to the provided value
end_date_min date OPTIONAL Lists ads with end date after or equal to the provided value
end_date_max date OPTIONAL Lists ads with end date before or equal to the provided value
date_modified_min date OPTIONAL Lists ads modified that day or after
date_modified_max date OPTIONAL Lists ads modified that day or before
date_created_min date OPTIONAL Lists ads created that day or after
date_created_max date OPTIONAL Lists ads created that day or before
business_ids string OPTIONAL Lists ads belonging to the specified businesses, comma separated
publisher_ids string OPTIONAL Lists ads published by the specified partners, comma separated
sorted_by string OPTIONAL Specifies the sorting order
size integer OPTIONAL Specifies the response size in ads amount (default: 20)
page integer OPTIONAL Specifies the page to retrieve based in the size parameter (default: 1)

Get a Specific Ad

curl "https://admin.austin.ownlocal.com/api/v1/ads/<id>" \
  -H "Authorization: <token>"

The above command returns JSON structured like this:

{
  "id": "f3e40418-3971-41da-ae8d-6171b2724246",
  "file_name": "783px-Test-Logo.svg.pdf",
  "custom_id": "",
  "business_id": "2db5e240-c098-4d59-b3a3-bc7b7abc2c4c",
  "publisher_id": "5ec5342e-7817-4151-8a4c-80b43cc8c024",
  "image": "https://storage.googleapis.com/ownlocal-adforge-production/ads/11492682/original_images.jpg",
  "start_date": "2020-10-22",
  "end_date": "2020-11-21",
  "date_modified": "2020-12-08",
  "date_created": "2020-10-22",
  "text": "test\n test",
  "origami_background_image": null
}

This endpoint retrieves a specific ad.

HTTP Request

GET http://admin.austin.ownlocal.com/api/v1/ads/<id>

URL Parameters

Parameter Description
id The id of the ad to retrieve

Create an Ad

curl -X POST "https://austin.ownlocal.com/api/v1/ads" \
  -H "Authorization: <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "publisher_id": "7e6ffeb2-22f3-4869-b189-d202996814cf",
    "business_id": "7942fe53-2738-47bb-a2c3-6c7373b374d4",
    "pdf_file_name": "filename.pdf"
  }"

The above command returns JSON structured like this:

{
  "ad_id": "88421798-7ba9-406b-bfd8-b930f16cacc4",
  "status": "created",
  "message": "Your ad for <publisher_url> was successfully created. Provide content for this ad at the url indicated in content_url.",
  "content_url": "https://austin.ownlocal.com/api/v1/ads/88421798-7ba9-406b-bfd8-b930f16cacc4/content"
}

This endpoint creates an ad. When this request completes, refer to Upload Ad file to continue with the process.

HTTP Request

POST https://admin.austin.ownlocal.com/api/v1/ads

Body Parameters

Parameter Type Description
publisher_id string REQUIRED The publisher under which this ad is going to be published
business_id string OPTIONAL The business this ad belongs to
business_email string OPTIONAL Business contact email. Business ID must be provided for the update to be applied
pdf_file_name string REQUIRED The pdf file name that will be uploaded in the upload content requests
start_date string OPTIONAL The start date for this ad, defaults to the current date. Required if end_date is provided
end_date string OPTIONAL The end date for this ad, defaults to the current date. Required if start_date is provided
use_dates_for_origami boolean OPTIONAL If true, origami_ad and print_ad will have the same run dates.

Upload Ad file

curl -X POST "https://admin.austin.ownlocal.com/api/v1/ads/<ad_id>/content" \
  -H "Authorization: <token>" \
  -H "Content-Type: multipart/form-data" \
  -F "file=@/path/to/file.pdf;type=application/pdf"

This endpoint uploads the PDF file for a specific ad

URL Parameters

Parameter Description
ad_id The ad's id for which the file will be updloaded

Form Parameters

Parameter Type Description
file pdf REQUIRED The ad file to upload. Must be pdf format

Businesses

Get Businesses

curl "https://admin.austin.ownlocal.com/api/v1/businesses" \
  -H "Authorization: <token>

The above command returns JSON structured like this:

[
  {
    "id": "d0932ac1-7f84-4125-84e6-dfaca305bd2b",
    "name": "Business name",
    "custom_id": "123-abc",
    "publishers": [
      "5ec5342e-7817-4151-8a4c-80b43cc8c024",
      "50ee5cfe-fdd7-4054-89d1-9a2c2b290585"
    ],
    "logo_url": null,
    "website": null,
    "urls": [
      {
        "Home": "http://www.site.com/"
      }
    ],
    "description": null,
    "email": null,
    "opening_hours": {
      "monday": "Appointments Only",
      "tuesday": "08:00AM - 10:00PM",
      "wednesday": "08:00AM - 10:00PM",
      "thursday": "08:00AM - 10:00PM",
      "friday": "08:00AM - 10:00PM",
      "saturday": "Open All Day",
      "sunday": "Close All Day"
    },
    "locations": [
      {
        "street_address": "123 Fake St.",
        "address_locality": "New York City",
        "address_region": "US-NY",
        "postal_code": "12345-1234",
        "telephones": [
          "+15551234560"
        ]
      }
    ],
    "categories": [
      "Shop Local"
    ],
    "sub_categories": [
      "Hours for the Elderly"
    ],
    "social": {
      "facebook_url": "",
      "instagram_url": "",
      "twitter_url": "",
      "youtube_url": "",
      "yelp_url": ""
    },
    "images": [
      "https://assets.ownlocal.com/images/a78feabb-df16-4fde-87aa-fba233d71671.jpeg",
      "https://assets.ownlocal.com/images/bbfe0e1f-0d8a-40df-86bd-c6a2250c09ec.jpeg"
    ],
    "date_modified": "2021-02-18",
    "date_created": "2021-02-18"
  },
  {
    "id": "d0932ac1-7f84-4125-84e6-dfaca305bd2b",
    "name": "Business name",
    ...
  }
]

This endpoint retrieves all businesses.

HTTP Request

GET https://admin.austin.ownlocal.com/api/v1/businesses

Body Parameters

Parameter Type Description
categories string array OPTIONAL Retrieves businesses belonging to those categories
sub_categories string array OPTIONAL Retrieves businesses belonging to those sub categories
date_modified_min date OPTIONAL Retrieves businesses modified that day or after
date_modified_max date OPTIONAL Retrieves businesses modified that day or before
date_created_min date OPTIONAL Retrieves businesses created that day or after
date_created_max date OPTIONAL Retrieves businesses created that day or before
date_ad_created_min date OPTIONAL Retrieves businesses with ads created that day or after
date_ad_created_max date OPTIONAL Retrieves businesses with ads created that day or before
date_ad_modified_min date OPTIONAL Retrieves businesses with ads modified that day or after
date_ad_modified_max date OPTIONAL Retrieves businesses with ads modified that day or before
publisher_ids string array OPTIONAL Retrieves businesses listed in those partners
sorted_by string OPTIONAL Specifies the sorting order
size integer OPTIONAL Specifies the response size in businesses amount (default: 30)
page integer OPTIONAL Specifies the page to retrieve based in the size parameter (default: 1)

Get a Specific Business

curl "https://admin.austin.ownlocal.com/api/v1/businesses/<id>" \
  -H "Authorization: <token>

The above command returns JSON structured like this:

{
  "id": "d0932ac1-7f84-4125-84e6-dfaca305bd2b",
  "name": "Business name",
  "custom_id": "123-abc",
  "publishers": [
    "5ec5342e-7817-4151-8a4c-80b43cc8c024",
    "50ee5cfe-fdd7-4054-89d1-9a2c2b290585"
  ],
  "logo_url": null,
  "website": null,
  "urls": [
    {
      "Home": "http://www.site.com/"
    }
  ],
  "description": null,
  "email": null,
  "opening_hours": {
    "monday": "Appointments Only",
    "tuesday": "08:00AM - 10:00PM",
    "wednesday": "08:00AM - 10:00PM",
    "thursday": "08:00AM - 10:00PM",
    "friday": "08:00AM - 10:00PM",
    "saturday": "Open All Day",
    "sunday": "Close All Day"
  },
  "locations": [
    {
      "street_address": "123 Fake St.",
      "address_locality": "New York City",
      "address_region": "US-NY",
      "postal_code": "12345-1234",
      "telephones": [
        "+15551234560"
      ]
    }
  ],
  "categories": [
    "Shop Local"
  ],
  "sub_categories": [
    "Hours for the Elderly"
  ],
  "social": {
    "facebook_url": "",
    "instagram_url": "",
    "twitter_url": "",
    "youtube_url": "",
    "yelp_url": ""
  },
  "images": [
    "https://assets.ownlocal.com/images/a78feabb-df16-4fde-87aa-fba233d71671.jpeg",
    "https://assets.ownlocal.com/images/bbfe0e1f-0d8a-40df-86bd-c6a2250c09ec.jpeg"
  ],
  "date_modified": "2021-02-18",
  "date_created": "2021-02-18"
}

This endpoint retrieves a specific business.

HTTP Request

GET https://admin.austin.ownlocal.com/api/v1/businesses/<id>

URL Parameters

Parameter Description
id The id of the business to retrieve

Create a Business

curl -X POST "https://admin.austin.ownlocal.com/api/v1/businesses" \
  -H "Authorization: <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "business": {
      "publishers": [
        "5ec5342e-7817-4151-8a4c-80b43cc8c024",
        "50ee5cfe-fdd7-4054-89d1-9a2c2b290585",
        ...
      ],
      "name": "Business name",
      "custom_id": "123-abc",
      "address": "123 Fake St.",
      "address2": "Office #123",
      "city": "New York City",
      "state": "NY",
      "country": "US",
      "zip": "12345",
      "zip_suffix": "1234",
      "phone": "555123456",
      "email": "someone@host.com",
      "fax": "(555)555-1234",
      "website": "www.business.com",
      "contact": "John Doe",
      "primary_sub_cat_id": 123,
      "long_description": "This business offers its clietns certain products and services..."
      "hours_of_operation": {
        "monday_open": "08:00AM",
        "monday_close": "10:00PM",
        "monday_open_24_hours": "0",
        "monday_closed_all_day": "0",
        "monday_by_appointment_only": "0",
        "tuesday_open": "08:00AM",
        "tuesday_close": "10:00PM",
        "tuesday_open_24_hours": "0",
        "tuesday_closed_all_day": "0",
        "tuesday_by_appointment_only": "0",
        "wednesday_open": "08:00AM",
        "wednesday_close": "10:00PM",
        "wednesday_open_24_hours": "0",
        "wednesday_closed_all_day": "0",
        "wednesday_by_appointment_only": "0",
        "thursday_open": "08:00AM",
        "thursday_close": "10:00PM",
        "thursday_open_24_hours": "0",
        "thursday_closed_all_day": "0",
        "thursday_by_appointment_only": "0",
        "friday_open": "08:00AM",
        "friday_close": "10:00PM",
        "friday_open_24_hours": "0",
        "friday_closed_all_day": "0",
        "friday_by_appointment_only": "0",
        "saturday_open": "",
        "saturday_close": "",
        "saturday_open_24_hours": "1",
        "saturday_closed_all_day": "0",
        "saturday_by_appointment_only": "0",
        "sunday_open": "",
        "sunday_close": "",
        "sunday_open_24_hours": "1",
        "sunday_closed_all_day": "0",
        "sunday_by_appointment_only": "0"
      }
    }
  }'

The above command return json structured like this

{
  "status": 200,
  "message": "Business created successfully",
  "business_id": "69271d95-e891-4bf7-a9ba-ce249e36e236",
}

This endpoint creates a business.

HTTP Request

POST https://admin.austin.ownlocal.com/api/v1/businesses

Body Parameters

Parameter type description
business object REQUIRED Contains the business information
publishers array REQUIRED Publishers ids this business advertices with. At least 1
name string REQUIRED The business name
custom_id string OPTIONAL A custom id given by the requester
address string OPTIONAL Address primary information
address2 string OPTIONAL Address secondary information
city string OPTIONAL Business location city
state string OPTIONAL Business location state. Must be in code format. To see available states refer to countries
country string OPTIONAL Business location country. Must be in code format. To see available countries refer to countries
zip string OPTIONAL Business location zip code
zip_suffix string OPTIONAL Business zip code suffix
email string OPTIONAL Business email
fax string OPTIONAL Business fax number
website string OPTIONAL Business website url
contact string OPTIONAL Business contact name
primary_sub_cat_id number OPTIONAL Business primary sub catgory. To see a list of available categories, refer to categories
long_description string OPTIONAL Business about section. Use this parameter to freely describe the business
hours_of_operation object OPTIONAL Business open time during the week
monday_open string OPTIONAL Business Monday opening time. 12 hours format only
monday_close string OPTIONAL Business Monday closing time. 12 hours format only
monday_open_24_hours string OPTIONAL Indicates if the business opens 24 hours on Monday. "1" or "0" only
monday_closed_all_day string OPTIONAL Indicates if the business does not open on Monday. "1" or "0" only
monday_by_appointment_only string OPTIONAL Indicates if an appointment is required to get attendance on Monday. "1" or "0" only
tuesday_open string OPTIONAL Business Tuesday opening time. 12 hours format only
tuesday_close string OPTIONAL Business Tuesday closing time. 12 hours format only
tuesday_open_24_hours string OPTIONAL Indicates if the business opens 24 hours on Tuesday. "1" or "0" only
tuesday_closed_all_day string OPTIONAL Indicates if the business does not open on Tuesday. "1" or "0" only
tuesday_by_appointment_only string OPTIONAL Indicates if an appointment is required to get attendance on Tuesday. "1" or "0" only
wednesday_open string OPTIONAL Business Wednesday opening time. 12 hours format only
wednesday_close string OPTIONAL Business Wednesday closing time. 12 hours format only
wednesday_open_24_hours string OPTIONAL Indicates if the business opens 24 hours on Wednesday. "1" or "0" only
wednesday_closed_all_day string OPTIONAL Indicates if the business does not open on Wednesday. "1" or "0" only
wednesday_by_appointment_only string OPTIONAL Indicates if an appointment is required to get attendance on Wednesday. "1" or "0" only
thursday_open string OPTIONAL Business Thursday opening time. 12 hours format only
thursday_close string OPTIONAL Business Thursday closing time. 12 hours format only
thursday_open_24_hours string OPTIONAL Indicates if the business opens 24 hours on Thursday. "1" or "0" only
thursday_closed_all_day string OPTIONAL Indicates if the business does not open on Thursday. "1" or "0" only
thursday_by_appointment_only string OPTIONAL Indicates if an appointment is required to get attendance on Thursday. "1" or "0" only
friday_open string OPTIONAL Business Friday opening time. 12 hours format only
friday_close string OPTIONAL Business Friday closing time. 12 hours format only
friday_open_24_hours string OPTIONAL Indicates if the business opens 24 hours on Friday. "1" or "0" only
friday_closed_all_day string OPTIONAL Indicates if the business does not open on Friday. "1" or "0" only
friday_by_appointment_only string OPTIONAL Indicates if an appointment is required to get attendance on Friday. "1" or "0" only
saturday_open string OPTIONAL Business Saturday opening time. 12 hours format only
saturday_close string OPTIONAL Business Saturday closing time. 12 hours format only
saturday_open_24_hours string OPTIONAL Indicates if the business opens 24 hours on Saturday. "1" or "0" only
saturday_closed_all_day string OPTIONAL Indicates if the business does not open on Saturday. "1" or "0" only
saturday_by_appointment_only string OPTIONAL Indicates if an appointment is required to get attendance on Saturday. "1" or "0" only
sunday_open string OPTIONAL Business Sunday opening time. 12 hours format only
sunday_close string OPTIONAL Business Sunday closing time. 12 hours format only
sunday_open_24_hours string OPTIONAL Indicates if the business opens 24 hours on Sunday. "1" or "0" only
sunday_closed_all_day string OPTIONAL Indicates if the business does not open on Sunday. "1" or "0" only
sunday_by_appointment_only string OPTIONAL Indicates if an appointment is required to get attendance on Sunday. "1" or "0" only

Update a Business

curl -X POST "https://admin.austin.ownlocal.com/api/v1/businesses/<id>" \
  -H "Authorization: <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "business": {
      "publishers": [
        "5ec5342e-7817-4151-8a4c-80b43cc8c024",
        "50ee5cfe-fdd7-4054-89d1-9a2c2b290585"
        ...
      ],
      "name": "Business name",
      "custom_id": "123-abc",
      "address": "123 Fake St.",
      "address2": "Office #123",
      "city": "New York City",
      "state": "NY",
      "country": "US",
      "zip": "12345",
      "zip_suffix": "1234",
      "phone": "5551234560",
      "email": "someone@host.com",
      "fax": "(555)555-1234",
      "website": "www.business.com",
      "contact": "John Doe",
      "primary_sub_cat_id": 1121,
      "long_description": "This business offers its clietns certain products and services..."
      "hours_of_operation": {
        "monday_open": "08:00AM",
        "monday_close": "10:00PM",
        "monday_open_24_hours": "0",
        "monday_closed_all_day": "0",
        "monday_by_appointment_only": "0",
        "tuesday_open": "08:00AM",
        "tuesday_close": "10:00PM",
        "tuesday_open_24_hours": "0",
        "tuesday_closed_all_day": "0",
        "tuesday_by_appointment_only": "0",
        "wednesday_open": "08:00AM",
        "wednesday_close": "10:00PM",
        "wednesday_open_24_hours": "0",
        "wednesday_closed_all_day": "0",
        "wednesday_by_appointment_only": "0",
        "thursday_open": "08:00AM",
        "thursday_close": "10:00PM",
        "thursday_open_24_hours": "0",
        "thursday_closed_all_day": "0",
        "thursday_by_appointment_only": "0",
        "friday_open": "08:00AM",
        "friday_close": "10:00PM",
        "friday_open_24_hours": "0",
        "friday_closed_all_day": "0",
        "friday_by_appointment_only": "0",
        "saturday_open": "",
        "saturday_close": "",
        "saturday_open_24_hours": "1",
        "saturday_closed_all_day": "0",
        "saturday_by_appointment_only": "0",
        "sunday_open": "",
        "sunday_close": "",
        "sunday_open_24_hours": "1",
        "sunday_closed_all_day": "0",
        "sunday_by_appointment_only": "0"
      }
    }
  }'

The above command return json structured like this

{
  "id": "d0932ac1-7f84-4125-84e6-dfaca305bd2b",
  "name": "Business name",
  "custom_id": "123-abc",
  "publishers": [
    "5ec5342e-7817-4151-8a4c-80b43cc8c024",
    "50ee5cfe-fdd7-4054-89d1-9a2c2b290585"
  ],
  "logo_url": null,
  "website": null,
  "urls": [
    {
      "Home": "http://www.site.com/"
    }
  ],
  "description": null,
  "email": null,
  "opening_hours": {
    "monday": "Appointments Only",
    "tuesday": "08:00AM - 10:00PM",
    "wednesday": "08:00AM - 10:00PM",
    "thursday": "08:00AM - 10:00PM",
    "friday": "08:00AM - 10:00PM",
    "saturday": "Open All Day",
    "sunday": "Close All Day"
  },
  "locations": [
    {
      "street_address": "123 Fake St.",
      "address_locality": "New York City",
      "address_region": "US-NY",
      "postal_code": "12345-1234",
      "telephones": [
        "+15551234560"
      ]
    }
  ],
  "categories": [
    "Shop Local"
  ],
  "sub_categories": [
    "Hours for the Elderly"
  ],
  "social": {
    "facebook_url": "",
    "instagram_url": "",
    "twitter_url": "",
    "youtube_url": "",
    "yelp_url": ""
  },
  "images": [
    "https://assets.ownlocal.com/images/a78feabb-df16-4fde-87aa-fba233d71671.jpeg",
    "https://assets.ownlocal.com/images/bbfe0e1f-0d8a-40df-86bd-c6a2250c09ec.jpeg"
  ],
    "date_modified": "2021-02-18",
    "date_created": "2021-02-18"
}

This endpoint updates a business.

HTTP Request

POST https://admin.austin.ownlocal.com/api/v1/businesses/<id>

Query Parameters

Parameter type description
id string (Required) The business id to update

Body Parameters

Parameter type description
business object REQUIRED Contains the business information
publishers array OPTIONAL Publishers ids this business advertices with
name string OPTIONAL The business name
custon_id string OPTIONAL A custom id given by the requester
address string OPTIONAL Address primary information
address2 string OPTIONAL Address secondary information
city string OPTIONAL Business location city
state string OPTIONAL Business location state. Must be in code format. To see available states refer to countries
country string OPTIONAL Business location country. Must be in code format. To see available countries refer to countries
zip string OPTIONAL Business location zip code
zip_suffix string OPTIONAL Business zip code suffix
email string OPTIONAL Business email
fax string OPTIONAL Business fax number
website string OPTIONAL Business website url
contact string OPTIONAL Business contact name
primary_sub_cat_id number OPTIONAL Business primary sub catgory. To see a list of available categories, refer to categories
long_description string OPTIONAL Business about section. Use this parameter to freely describe the business
hours_of_operation object OPTIONAL Business open time during the week
monday_open string OPTIONAL Business Monday opening time. 12 hours format only
monday_close string OPTIONAL Business Monday closing time. 12 hours format only
monday_open_24_hours string OPTIONAL Indicates if the business opens 24 hours on Monday. "1" or "0" only
monday_closed_all_day string OPTIONAL Indicates if the business does not open on Monday. "1" or "0" only
monday_by_appointment_only string OPTIONAL Indicates if an appointment is required to get attendance on Monday. "1" or "0" only
tuesday_open string OPTIONAL Business Tuesday opening time. 12 hours format only
tuesday_close string OPTIONAL Business Tuesday closing time. 12 hours format only
tuesday_open_24_hours string OPTIONAL Indicates if the business opens 24 hours on Tuesday. "1" or "0" only
tuesday_closed_all_day string OPTIONAL Indicates if the business does not open on Tuesday. "1" or "0" only
tuesday_by_appointment_only string OPTIONAL Indicates if an appointment is required to get attendance on Tuesday. "1" or "0" only
wednesday_open string OPTIONAL Business Wednesday opening time. 12 hours format only
wednesday_close string OPTIONAL Business Wednesday closing time. 12 hours format only
wednesday_open_24_hours string OPTIONAL Indicates if the business opens 24 hours on Wednesday. "1" or "0" only
wednesday_closed_all_day string OPTIONAL Indicates if the business does not open on Wednesday. "1" or "0" only
wednesday_by_appointment_only string OPTIONAL Indicates if an appointment is required to get attendance on Wednesday. "1" or "0" only
thursday_open string OPTIONAL Business Thursday opening time. 12 hours format only
thursday_close string OPTIONAL Business Thursday closing time. 12 hours format only
thursday_open_24_hours string OPTIONAL Indicates if the business opens 24 hours on Thursday. "1" or "0" only
thursday_closed_all_day string OPTIONAL Indicates if the business does not open on Thursday. "1" or "0" only
thursday_by_appointment_only string OPTIONAL Indicates if an appointment is required to get attendance on Thursday. "1" or "0" only
friday_open string OPTIONAL Business Friday opening time. 12 hours format only
friday_close string OPTIONAL Business Friday closing time. 12 hours format only
friday_open_24_hours string OPTIONAL Indicates if the business opens 24 hours on Friday. "1" or "0" only
friday_closed_all_day string OPTIONAL Indicates if the business does not open on Friday. "1" or "0" only
friday_by_appointment_only string OPTIONAL Indicates if an appointment is required to get attendance on Friday. "1" or "0" only
saturday_open string OPTIONAL Business Saturday opening time. 12 hours format only
saturday_close string OPTIONAL Business Saturday closing time. 12 hours format only
saturday_open_24_hours string OPTIONAL Indicates if the business opens 24 hours on Saturday. "1" or "0" only
saturday_closed_all_day string OPTIONAL Indicates if the business does not open on Saturday. "1" or "0" only
saturday_by_appointment_only string OPTIONAL Indicates if an appointment is required to get attendance on Saturday. "1" or "0" only
sunday_open string OPTIONAL Business Sunday opening time. 12 hours format only
sunday_close string OPTIONAL Business Sunday closing time. 12 hours format only
sunday_open_24_hours string OPTIONAL Indicates if the business opens 24 hours on Sunday. "1" or "0" only
sunday_closed_all_day string OPTIONAL Indicates if the business does not open on Sunday. "1" or "0" only
sunday_by_appointment_only string OPTIONAL Indicates if an appointment is required to get attendance on Sunday. "1" or "0" only

Upload Logo for a Business

curl -X POST "https://admin.austin.ownlocal.com/api/v1/businesses/<id>/logo" \
 -H "Authorization: <token>" \
 -H "Content-Type: multipart/form-data" \
 -F "file=<file.png>;type=image/<format>"

The above command returns JSON structured like this:

{
  "message": "Logo uploaded successfully"
}

Use this endpoint to upload the logo for a specific business.

URL Parameters

Parameter Description
id The business's id for which the logo will be uploaded

Form Parameters

Parameter Type Description
file image REQUIRED The image to upload

Upload Image for a Business

curl -X POST "https://admin.austin.ownlocal.com/api/v1/businesses/<id>/images" \
 -H "Authorization: <token>" \
 -H "Content-Type: multipart/form-data" \
 -F "file=<file.png>;type=image/<format>"

The above command returns JSON structured like this:

{
  "message": "Image uploaded successfully"
}

Use this endpoint to upload images for a specific business.

URL Parameters

Parameter Description
id The business's id for which the image will be updloaded

Form Parameters

Parameter Type Description
file image REQUIRED The image to upload

Categories

Get Categories

curl "https://admin.austin.ownlocal.com/api/v1/categories" \
  -H "Authorization: <token>

The above command returns JSON structured like this:

[
  {
    "title": "Communication",
    "sub_categories": {
      "102": "Broadcasting Services",
      "103": "Cable TV",
      "104": "Newspapers and Magazines",
      "105": "Other",
      "106": "Publishing",
      "107": "Radio Stations",
      "108": "Telecommunications",
      "109": "TV Stations"
    }
  }
]

This endpoint returns all categories

HTTP Request

GET https://admin.austin.ownlocal.com/api/v1/categories

Body Parameters

Parameter Type Default Description
size integer 25 OPTIONAL Specifies the response size in categories amount
page integer 1 OPTIONAL Specifies the page to retrieve based in the size parameter

Reports

Ads

curl "https://admin.austin.ownlocal.com/api/v1/reports/ads" \
  -H "Authorization: <token>

The above command returns JSON structured like this:

{
  "start_date": "2020-06-01",
  "end_date": "2020-07-01",
  "publisher_name": "The Pub News",
  "publisher_id": "2db5e240-c098-4d59-b3a3-bc7b7abc2c4c",
  "ads": [
    {
      "ad_id": "681d4eb4-f07a-4bf8-b9f3-49f3e236a244",
      "origmai_id": "87415afa-ac85-4f55-b869-c63532d02ffe",
      "report_url": "http://reports.ownlocal.com/ad-report/87415afa-ac85-4f55-b869-c63532d02ffe",
      "business_id": "6f5bc030-224b-4eda-bd2a-abb92beb4b29",
      "start_date": "2020-06-24 06:00:00 -0600",
      "end_date": "2020-06-25 06:00:00 -0600",
      "data": {
        "total_views": 11346,
        "interaction_breakdown": {
          "breakdowns": {
            "overall": {
              "total_clicks": 14,
              "about_us_clicks": 0,
              "contact_clicks": 0,
              "expand_ad_unit_clicks": 9,
              "print_ad_clicks": 0,
              "website_clicks": 3,
              "facebook_clicks": 0,
              "twitter_clicks": 0,
              "instagram_clicks": 0,
              "yelp_clicks": 0,
              "call_clicks": 2,
              "directions_clicks": 0,
              "contact_form_submits": 0,
              "share": 0
            }
          }
        },
        "leads": 5,
        "digital_lift": 10.532343
      }
    },
    {
      "origami_id": "a3c6f485-07b1-4241-9bc7-9945be77d0a5",
      "report_url": "http://reports.ownlocal.com/ad-report/a3c6f485-07b1-4241-9bc7-9945be77d0a5",
      "business_id": "6f5bc030-224b-4eda-bd2a-abb92beb4b29",
      "start_date": "2020-06-27 06:00:00 -0600",
      "end_date": "2020-06-28 06:00:00 -0600",
      "data": {
        "total_views": 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
            }
          }
        },
        "leads": 0,
        "digital_lift": 12.334524
      }
    },
    ...
  ]
}

This endpoint returns reports data for all the ads running during the given dates or for a given specific ad.

HHTP Request

GET https://admin.austin.ownlocal.com/api/v1/reports/ads

Body Parameters

Parameter Type Default Description
publisher_id string - REQUIRED The reports will be generated only for ads published by the provided partner
start_date date 1 month ago OPTIONAL Sets the start date for the report's data
end_date date today OPTIONAL Sets the end date for the report's data
ad_id string - OPTIONAL If provided, only data for this specific ad will be generated. This can be either an ad id or an origami id

Business

curl "https://admin.austin.ownlocal.com/api/v1/reports/business" \
  -H "Authorization: <token>

The above command returns JSON structured like this:

{
  "start_date": "2020-06-01 00:00:00",
  "end_date": "2020-07-01 23:59:59",
  "report_url": "https://reports.secure.ownlocal.com/business-report/0?business_id=<business_id>&publisher_id=<publisher_id>&start_date=2020-06-01&end_date=2020-07-01",
  "business_name": "Local Bakery",
  "business_id": "2db5e240-c098-4d59-b3a3-bc7b7abc2c4c",
  "ads": [
    {
      "id": "5b7a3580-91e5-4bc3-a094-16a4159bf415",
      "start_date": "2024-05-18T06:00:00.000-05:00",
      "end_date": "2024-05-25T06:00:00.000-05:00",
      "reach_data": {
        "impressions": 765,
        "total_clicks": 2,
        "about_us_clicks": 0,
        "contact_clicks": 0,
        "expand_ad_unit_clicks": 1,
        "print_ad_clicks": 0,
        "website_clicks": 1,
        "facebook_clicks": 0,
        "twitter_clicks": 0,
        "instagram_clicks": 0,
        "yelp_clicks": 0,
        "call_clicks": 0,
        "directions_clicks": 0,
        "contact_form_submits": 0,
        "share": 0
      }
    },
    ...
  ],
  "reach_report": {
    "print_reach": 29274,
    "total_views": 192890,
    "leads": 5,
    "digital_lift": 658.9123454259752,
    "total_ads": 13,
    "directory": {
      "days": 31,
      "impressions": 66796,
      "article_impressions": 121441
    },
    "origami": {
      "ads": 9,
      "days": 10,
      "impressions": {
        "overall": 277160
      }
    },
    "interaction_breakdown": {
      "breakdowns": {
        "overall": {
          "total_clicks": 23,
          "about_us_clicks": 0,
          "contact_clicks": 0,
          "expand_ad_unit_clicks": 1,
          "print_ad_clicks": 0,
          "website_clicks": 3,
          "facebook_clicks": 0,
          "twitter_clicks": 0,
          "instagram_clicks": 0,
          "yelp_clicks": 0,
          "call_clicks": 0,
          "directions_clicks": 2,
          "contact_form_submits": 0,
          "share": 3,
          "coupons_printed": 0,
          "question_intents": 14
        }
      }
    }
  },
  "search_report": {
    "keywords": [
      {
        "id": 1098171,
        "keyword": "Bakeries in Location",
        "has_search": true,
        "closest_rank": null,
        "current_rank": 12,
        "initial_rank": 5,
        "initial_date": "2020-03-02",
        "rank_history": [
          {
            "date": "2020-03-02",
            "rank": 5
          },
          {
            "date": "2020-03-30",
            "rank": 7
          },
          {
            "date": "2020-05-04",
            "rank": 4
          },
          {
            "date": "2020-06-01",
            "rank": 8
          },
          {
            "date": "2020-06-28",
            "rank": 12
          }
        ],
        "search_results": [
          {
              "rank": 2,
              "url": "https://www.somewhere.com/",
              "name": "Bakeries recommendations",
              "is_current_business": false
          },
          {
            "rank": 12,
            "url": "https://www.localbakery.com/",
            "name": "My Local Bakery",
            "is_current_business": true
          },
          {
            "rank": 13,
            "url": "https://www.somewhere.com/",
            "name": "Bakeries in Location | Somplace | Country",
            "is_current_business": false
          }
        ]
      },
      {
        "id": 1088516,
        "keyword": "Cafeterias in Location",
        "has_search": true,
        "closest_rank": null,
        "current_rank": 37,
        "initial_rank": 86,
        "initial_date": "2020-04-02",
        "rank_history": [
          {
            "date": "2020-04-06",
            "rank": 37
          },
          {
            "date": "2020-05-11",
            "rank": "100+"
          },
          {
            "date": "2020-06-09",
            "rank": "100+"
          },
          {
            "date": "2020-06-23",
            "rank": 86
          }
        ],
        "search_results": [
          {
            "rank": 2,
            "url": "https://www.cafeterias.com/listServices.aspx?region=Somewhere",
            "name": "Cafeterias in here",
            "is_current_business": false
          },
          {
            "rank": 36,
            "url": "https://placesyouwoulddrinkacoffee/",
            "name": "Coffee fans",
            "is_current_business": false
          },
          {
            "rank": 37,
            "url": "https://www.localbakery.com/",
            "name": "My Local Bakery",
            "is_current_business": true
          },
          {
            "rank": 38,
            "url": "https://www.iwantthiscake.com/",
            "name": "Discover intereting cafeterias in your location",
            "is_current_business": false
          }
        ]
      }
    ]
  }
}

This endpoint returns reports data for a specific business in the given dates.

HTTP Request

GET https://admin.austin.ownlocal.com/api/v1/reports/business

Query Parameters

Parameter Type Default Description
publisher_id string - REQUIRED The partner the business is listed under.
business_id string - OPTIONAL The business to generate data from. If not provided, all partner's businesses reports will be generated
start_date date 1 month ago OPTIONAL Sets the start date for the report's data
end_date date today OPTIONAL Sets the end date for the report's data

Models

Ad

{
  "ad_id(string)":  "795d064b-1810-4f6b-bada-6a9f7d534579",
  "file_name(string)": "{original_filename}.pdf",
  "custom_id(string)": "234567",
  "business_id(string)": "2db5e240-c098-4d59-b3a3-bc7b7abc2c4c",
  "publisher_id(string)": "2db5e240-c098-4d59-b3a3-bc7b7abc2c4c",
  "image(string)": "https://assets.ownlocal.com/ads/795d064b-1810-4f6b-bada-6a9f7d534579/order_image.jpeg",
  "start_date(date)": "2019-09-01",
  "end_date(date)": "2019-09-30",
  "date_modified(date)": "2019-09-03",
  "date_created(date)": "2019-09-03",
  "ad_text(string)": "This is an example ad text.",
}

Business

{
  "id(string)": "69271d95-e891-4bf7-a9ba-ce249e36e236",
  "name(string)": "Cielo Azul Mexican Grill" (Required),
  "custom_id(string)": "23456",
  "publishers(array)":  [
    "e94df8d7-cc45-4ec9-b9fa-e42f04f74c38",
    "9103093d-596a-4ed4-a0ea-d7a5bfc35912"
  ],
  "logo_url(string)": "http://www.cielobluemexreservations.com/CieloBlueMexicanGrill_logo.jpg",
  "website(string)": "http://www.cielobluecantina.com",
  "urls(array)": [
    {
      "url(string)": "www.exampleurl.com",
      "label(string)": "homepage"
    },
    {...}
  ],
  "description(string)": "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(string)": "generalmgr@cielobluecantina.com",
  "opening_hours": {
        "monday": "Appointments Only",
        "tuesday": "Unavailable",
        "wednesday": "Unavailable",
        "thursday": "Unavailable",
        "friday": "08:00AM - 10:00PM",
        "saturday": "Open All Day",
        "sunday": "Close All Day"
    },
  "locations(array)":   [
    {
      "streetAddress(string)": "197 Bloor St E",
      "addressLocality(string)": "Oshawa",
      "addressRegion(string)": "ON",
      "postalCode(string)": "L1H 3M3",
      "telephones(array)": [
        "905-720-2326",
        "905-720-2326",
      ]
    },
    {...}
  ],
  "categories(array)": [
    "Food and Beverage"
  ],
  "subCategories(array)": [
    "Mexican Food"
  ],
  "social(object)": {
    "facebook_url(string)": "https://www.facebook.com/CieloBlueBelmont/",
    "instagram_url(string)": "https://www.instagram.com/CieloBlueBelmont/",
    "twitter_url(string)": "https://www.twitter.com/CieloBlueBelmont/",
    "youtube_url(string)": "https://www.youtube.com/CieloBlueBelmont/",
    "yelp_url(string)": "https://www.yelp.com/biz/Cielo-Blue-Belmont"
  },
  "images(array)": [
    "https://assets.ownlocal.com/images/a78feabb-df16-4fde-87aa-fba233d71671.jpeg",
    "https://assets.ownlocal.com/images/bbfe0e1f-0d8a-40df-86bd-c6a2250c09ec.jpeg"
  ],
  "date_modified": "2021-02-18",
  "date_created": "2021-02-18"
}

Countries

List of all countries and states available.

{
  "Australia": {
    "code": "AU",
    "states": {
      "ACT": "Australian Capital Territory",
      "NSW": "New South Wales",
      "NT": "Northern Territory",
      "QLD": "Queensland",
      "SA": "South Australia",
      "TAS": "Tasmania",
      "VIC": "Victoria",
      "WA": "Western Australia"
    }
  },
  "Austria": {
    "code": "AT",
    "states": {
      "BGL": "Burgenland",
      "KTN": "Kärnten",
      "NÖ": "Niederösterreich",
      "OÖ": "Oberösterreich",
      "SBG": "Salzburg",
      "STM": "Steiermark",
      "TIR": "Tirol",
      "VBG": "Vorarlberg",
      "WIE": "Wien"
    }
  },
  "Belgium": {
    "code": "BE",
    "states": {
      "AN": "Antwerp",
      "OV": "East Flanders",
      "VB": "Flemish Brabant",
      "LI": "Limburg",
      "WV": "West Flanders",
      "HT": "Hainaut",
      "LG": "Liège",
      "LX": "Luxembourg",
      "NA": "Namur",
      "BW": "Walloon Brabant",
      "BRU": "Brussles"
    }
  },
  "Canada": {
    "code": "CA",
    "states": {
      "AB": "Alberta",
      "BC": "British Columbia",
      "MB": "Manitoba",
      "NB": "New Brunswick",
      "NL": "Newfoundland and Labrador",
      "NS": "Nova Scotia",
      "ON": "Ontario",
      "PE": "Prince Edward Island",
      "QC": "Quebec",
      "SK": "Saskatchewan",
      "NT": "Northwest Territories",
      "YT": "Yukon",
      "NU": "Nunavut"
    }
  },
  "Denmark": {
    "code": "DK",
    "states": {
      "HS": "Hovedstaden",
      "MJ": "Midtjylland",
      "ND": "Nordjylland",
      "SD": "Sjælland",
      "SL": "Syddanmark"
    }
  },
  "Germany": {
    "code": "DE",
    "states": {
      "BB": "Brandenburg",
      "BE": "Berlin",
      "BW": "Baden-Württemberg",
      "BY": "Bavaria",
      "HB": "Bremen",
      "HE": "Hesse",
      "HH": "Hamburg",
      "MV": "Mecklenburg-Vorpommern",
      "NI": "Lower Saxony",
      "NW": "North Rhine-Westphalia",
      "RP": "Rhineland-Palatinate",
      "SH": "Schleswig-Holstein",
      "SL": "Saarland",
      "SN": "Saxony",
      "ST": "Saxony-Anhalt",
      "TH": "Thuringia"
    }
  },
  "Honduras": {
    "code": "HN",
    "states": {
      "AT": "Atlántida",
      "CH": "Choluteca",
      "CL": "Colón",
      "CM": "Comayagua",
      "CP": "Copán",
      "CR": "Cortés",
      "EP": "El Paraíso",
      "FM": "Francisco Morazán",
      "GD": "Gracias a Dios",
      "IN": "Intibucá",
      "IB": "Islas de la Bahía",
      "LP": "La Paz",
      "LE": "Lempira",
      "OC": "Ocotepeque",
      "OL": "Olancho",
      "SB": "Santa Bárbara",
      "VA": "Valle",
      "YO": "Yoro"
    }
  },
  "Ireland": {
    "code": "IE",
    "states": {
    }
  },
  "Mexico": {
    "code": "MX",
    "states": {
      "Ags": "Aguascalientes",
      "BC": "Baja California",
      "BCS": "Baja California Sur",
      "Camp": "Campeche",
      "Chih": "Chihuahua",
      "Chis": "Chiapas",
      "Coah": "Coahuila",
      "Col": "Colima",
      "DF": "Distrito Federal",
      "Dgo": "Durango",
      "Edomex": "México",
      "Gro": "Guerrero",
      "Gto": "Guanajuato",
      "Hgo": "Hidalgo",
      "Jal": "Jalisco",
      "Mich": "Michoacán",
      "Mor": "Morelos",
      "Nay": "Nayarit",
      "NL": "Nuevo León",
      "Oax": "Oaxaca",
      "Pue": "Puebla",
      "Qro": "Querétaro",
      "QR": "Quintana Roo",
      "Sin": "Sinaloa",
      "SLP": "San Luis Potosí",
      "Son": "Sonora",
      "Tab": "Tabasco",
      "Tamps": "Tamaulipas",
      "Tlax": "Tlaxcala",
      "Ver": "Veracruz",
      "Yuc": "Yucatán",
      "Zac": "Zacatecas"
    }
  },
  "Netherlands": {
    "code": "NL",
    "states": {
      "DR": "Drenthe",
      "FL": "Flevoland",
      "FR": "Friesland",
      "GE": "Gelderland",
      "GR": "Groningen",
      "LI": "Limburg",
      "NB": "North Brabant",
      "NH": "North Holland",
      "OV": "Overijssel",
      "ZH": "South Holland",
      "UT": "Utrecht",
      "ZE": "Zeeland"
    }
  },
  "New Zealand": {
    "code": "NZ",
    "states": {
      "NTL": "Northland",
      "AUK": "Auckland",
      "WKO": "Waikato",
      "BOP": "Bay of Plenty",
      "GIS": "Gisborne",
      "HKB": "Hawke’s Bay",
      "TKI": "Taranaki",
      "MWT": "Manawatu-Whanganui",
      "WGN": "Wellington",
      "TAS": "Tasman",
      "NSN": "Nelson",
      "MBH": "Marlborough",
      "WTC": "West Coast",
      "CAN": "Canterbury",
      "OTA": "Otago",
      "STL": "Southland",
      "CIT": "Chatham Islands Territory",
      "N": "North Island",
      "S": "South Island"
    }
  },
  "Panama": {
    "code": "PA",
    "states": {
      "BC": "Bocas del Toro",
      "CH": "Chiriquí",
      "CC": "Coclé",
      "CL": "Colón",
      "DA": "Darién",
      "EM": "Emberá",
      "HE": "Herrera",
      "SB": "Kuna Yala",
      "LS": "Los Santos",
      "KM": "Kuna de Madungandí",
      "KW": "Kuna de Wargandí",
      "NB": "Ngäbe-Buglé",
      "PM": "Panamá",
      "PO": "Panamá Oeste",
      "VR": "Veraguas"
    }
  },
  "United Kingdom": {
    "code": "GB",
    "states": {
    }
  },
  "United States": {
    "code": "US",
    "states": {
      "AK": "Alaska",
      "AL": "Alabama",
      "AZ": "Arizona",
      "AR": "Arkansas",
      "CA": "California",
      "CO": "Colorado",
      "CT": "Connecticut",
      "DC": "Washington DC",
      "DE": "Delaware",
      "FL": "Florida",
      "GA": "Georgia",
      "HI": "Hawaii",
      "IA": "Iowa",
      "ID": "Idaho",
      "IL": "Illinois",
      "IN": "Indiana",
      "KS": "Kansas",
      "KY": "Kentucky",
      "LA": "Louisiana",
      "MA": "Massachusetts",
      "ME": "Maine",
      "MD": "Maryland",
      "MI": "Michigan",
      "MN": "Minnesota",
      "MO": "Missouri",
      "MS": "Mississippi",
      "MT": "Montana",
      "NC": "North Carolina",
      "NE": "Nebraska",
      "NH": "New Hampshire",
      "NV": "Nevada",
      "NJ": "New Jersey",
      "NM": "New Mexico",
      "NY": "New York",
      "ND": "North Dakota",
      "OH": "Ohio",
      "OK": "Oklahoma",
      "OR": "Oregon",
      "PA": "Pennsylvania",
      "RI": "Rhode Island",
      "SC": "South Carolina",
      "SD": "South Dakota",
      "TN": "Tennessee",
      "TX": "Texas",
      "UT": "Utah",
      "VA": "Virginia",
      "VT": "Vermont",
      "WA": "Washington",
      "WI": "Wisconsin",
      "WY": "Wyoming",
      "WV": "West Virginia",
      "AS": "American Samoa",
      "GU": "Guam",
      "MP": "Northern Mariana Islands",
      "PR": "Puerto Rico",
      "VI": "Virgin Islands"
    }
  }
}

Errors

The OwnLocal API uses the following error codes:

Error Code Meaning
400 Bad Request -- Your request is invalid.
401 Unauthorized -- Your API key is wrong.
403 Forbidden -- The resource requested is hidden for administrators only.
404 Not Found -- The specified resource could not be found.
405 Method Not Allowed -- You tried to access a resource with an invalid method.
406 Not Acceptable -- You requested a format that isn't json.
410 Gone -- The resource requested has been removed from our servers.
418 I'm a teapot.
429 Too Many Requests -- You're requesting too many resources! Slow down!
500 Internal Server Error -- We had a problem with our server. Try again later.
503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later.