Businesses

Overview

A business is a single location that is associated to it's own unique social profiles.

Example: Walmart, 8300 W. Overland Rd. Boise, ID, 83706

In the example above, Reply Pro will give the data only associated to that specific Walmart location.

1186

Businesses are generally physical locations all associated to the same account.

πŸ“˜

Corporate Pages

Sometimes multi-location clients have generic pages (i.e company Facebook Page) that represent their entire brand and is not associated to a specific, physical location. In these cases, Reply Pro generally creates an additional business location called "Corporate."

Default Fields

The following fields are used to access business data:

FieldTypeDescription
name
stringThe name associated to the Business object. This can be the same name as an account.
id
intThe ID associated to the business used to make API calls associated to the business. Every location will have a unique ID

Additional Fields

The following fields are used to access additional data for businesses via the parameter "fields" as a comma separated string:

See example below.

FieldTypeDescription
address stringExample: "305 Main St."
group_idstringUsed only in POST and PUT, this allows you to assign a business to a Group directly during creation or updating. If you want to GET businesses by group use Groups
latitudedecimalExample: 179.000001
locality stringExample: "Las Vegas"
""longitudedecimalExample: -110.000001
province stringExample: "NV"
country stringExample: "United States"
remote_idstringThis is a field intended to make it simpler for you to relate your data to ours.
Example: "123-Z"
statusstringThis field denotes the pay status of a business. Options are: "dormant", "trial", and "paid".
typestringThis field denotes the update type for the business. Options are: "managed", "monitoring", "reporting", and "unsubscribed"

πŸ“˜

type options

managed businesses receive suggested response updates and get updated twice daily, monitoring businesses get updated twice daily, reporting businesses get updated data once per month, and unsubscribed businesses do not get updated.

List All Businesses

Use this URL to request all businesses for the authenticated user:

https://ad1.replypro.io/api/public/accounts/<account_id>/companies/<company_id>/businesses

Example of returned data:

{
  "next": null,
  "previous": null,
  "results": [
    {
      "id": 28675,
      "name": "Local Bakeries",
      "status": "paid",
      "type": "reporting"
    },
    {
      "id": 86752,
      "name": "Code Nibblers",
      "status": "trial",
      "type": "managed"
    }
  ]
}

🚧

Pagination for 50+ Businesses

If you are trying to request for more than 50 businesses, you will need to use pagination.

Get Business

Use this URL to request a single business object:

https://ad1.replypro.io/api/public/accounts/<account_id>/companies/<company_id>/businesses/<business_id>

Example of Returned Data:

{
  "next": null,
  "previous": null,
  "results": [
    {
      "id": 28675,
      "name": "Local Bakeries",
      "status": "paid",
      "type": "monitoring"
    }
  ]
}

Get Business with additional fields

This is an example of requesting businesses with additional fields:

https://ad1.replypro.io/api/public/accounts/<account_id>/companies/<company_id>/businesses/<business_id>?fields=address,locality

Example of returned data with additional fields:

{
  "next": null,
  "previous": null,
  "results": [
    {
      "id": 28675,
      "address": "8976 Here Ave",
      "locality": "Boise",
      "status": "trial",
      "type": "reporting"
    }
  ]
}

🚧

Note:

If additional fields are specified, default fields are not provided unless included in the fields parameter.

Filtering

Looking to filter by specific values in a field? Checkout Filters

Custom Filter Methods

Occasionally you'll find it convenient to filter businesses by relationships to other resources. We currently support filtering by the following methods:

MethodValueDescription
suggestionsTrueFilters the businesses being returned by whether or not they have Suggested Actions for them.

Examples:

https://ad1.replypro.io/api/public/accounts/<account_id>/companies/<company_id>/businesses?suggestions=True

Adding Businesses

To create a new Business, submit a POST request to following URL containing, at minimum, the name, address, city, and state for the new Business. A remote_id can also be included in the request.

https://ad1.replypro.io/api/public/accounts/<account_id>/companies/<company_id>/businesses
{
  "name": "Added Business",
  "address": "123 Test Ave",
  "locality": "Boise",
  "province": "Idaho",
  "remote_id": 124579, // Optional field
  "group_id": 21 // Optional field, must be an already existing Group
}

The return from a successful POST to create a business would look something like the following:

{
  "name": "Added Business",
  "address": "123 Test Ave",
  "locality": "Boise",
  "province": "Idaho",
  "remote_id": 124579,
  "status": "dormant",
  "type": "unsubscribed"
}

Updating the Business

You can update certain fields of a Business resource by making a PUT request to the endpoint with the fields you are updating specified in the body.

https://ad1.replypro.io/api/public/accounts/<account_id>/companies/<company_id>/businesses/<business_id>

Fields Allowing Update

FieldTypeDescription
addressStringUpdating the address will replace what we currently have on file for this Business
countryStringUpdating the country will replace what we currently have on file for this Business
group_idStringProviding a group_id in a PUT request will add the business to the specified group.
localityStringUpdating the locality will replace what we currently have on file for this Business
nameStringThe name associated to the Business object. This can be the same name as an account.
provinceStringUpdating the province will replace what we currently have on file for this Business
remote_idStringThis is a field allowing you to relate our objects to yours if you have your own database.
typeStringThis field denotes the pay status of a business. Options are: "dormant", "trial", and "paid".
statusStringThis field denotes the update type for the business. Options are: "managed", "monitoring", "reporting", and "unsubscribed"

In the sample below, we will be making a request to update the name and remote_id of a business using the url https://ad1.replypro.io/accounts/<account_id>/companies/<company_id>/businesses/28765.

{
  "name": "Local Bakery",
  "remote_id": 143267,
  "status": "trial",
  "type": "reporting"
}

The response to the above request would be as follows:

{
  "id": 28675,
  "name": "Local Bakery",
  "remote_id": 143267,
  "status": "trial",
  "type": "reporting"
}

What’s Next

Groups help organize locations into districts, regions, etc.