Working with Multiple Companies

Most Meltwater customers have one company. This company is associated with their API package, API token, and with the searches they create in the application and API.

If you have access to multiple companies then you have a default company which is associated to your API package and API token, but you can access the searches for your default company and other companies you have access to.

For earned media features you can use the API to manage the searches of the companies you have access to, plus you can use these searches to export and analyze content.

For owned social features you can use the API to access metrics and analytics for the social accounts of the companies you have access to.

Limits and content restrictions

When you call the API limits are applied according to the package of your default company

Note that for earned media features any content restrictions that are applied relate to the company that owns the search you are using. For example, if your default company is based in the US, but the company that owns the search is based in Australia, the content provided by the API will have content rules applied for Australian customers.

Fetching companies from the API

To access searches of your multiple companies you need to know the IDs of these companies.

You can fetch companies using the /accounts/me/companies endpoint. See the endpoints specification for details.

curl -X GET \
  --url "https://api.meltwater.com/v3/accounts/me/companies" \
  --header "Accept: application/json" \
  --header "apikey: **********"

This endpoint returns the companies you have access to:

{
  "companies": [
    {
      "name": "Your company",
      "id": "61d07a1eb6b...."
    },
    {
      "name": "2nd company",
      "id": "61d07a1eb6b...."
    }
  ]
}

To manage searches or export data using searches for a company other than your default company you will use the ID of the appropriate company.

Specifying the target company for earned media features

Fetching searches of another company

By default when you fetch searches from the API you will receive the searches belonging to your default company.

If however you provide the company_id parameter with the ID of another company you have access to, you will receive the searches for that company. (See the endpoints specification for details.)

curl -X GET \
  --url "https://api.meltwater.com/v3/searches?company_id=61d07a1eb6b..." \
  --header "Accept: application/json" \
  --header "apikey: **********" 

You can then use these searches to run an export.

Exporting earned media using a search from another company

By default when you create an export using the API you can use a search from your default company.

If however you provide the company_id parameter with the ID of another company you have access to, you can run an export using a saved search for that company. (See the endpoints specification for details.)

curl -X POST \
  --url "https://api.meltwater.com/v3/exports/one-time?company_id=61d07a1eb6b..." \
  --header "Content-Type: application/json" \
  --header "Accept: application/json" \
  --header "apikey: **********" 
  --data "{
  \"onetime_export\": {
	\"search_ids\": [<search_id>],
	\"start_date\": \"2018-09-01T01:00:00\",
	\"end_date\": \"2018-10-01T01:00:00\"
  }
}"

The export itself will be owned by the default company and package limits will be applied for this company, however the saved search details will be accessed from the other company.

Analyzing earned media using a search from another company

By default when you run analytics using the API you can use a search from your default company.

If however you provide the company_id parameter with the ID of another company you have access to, you can run analytics using a saved search for that company. (See the endpoints specification for details.)

Streaming earned media using a search from another company

By default when you create a data stream using the API you can use a search from your default company.

If however you provide the company_id parameter with the ID of another company you have access to, you can run an data stream using a saved search for that company. (See the endpoints specification for details.)

Managing searches for another company

Managing searches and source selections for a specific (ie non-default) company is simple. Most of the search / source selection endpoints accept an optional query parameter named company_id. If this paramater is specified the request will be made for that particular company (otherwise, it will fall back to your default company). See the endpoints specification for details.

Specifying the target company for owned social features

By default when you call owned social endpoints the API will try to access accounts connected to your default company.

If however you provide the company_id parameter with the ID of another company you have access to, the API will be able to access social accounts connected to the company you specify.