Getting sites with a specific tag from customer

Hi,
with the API I can collect all sites from a customer with the command:
GET /1/customers/$CID/sites

My problem now is, that the customer has a lot of sites which are separated by tags. Is there any command to just get the sites from a customer with a tag?

Kind regards
Johannes

Hello @Johannes_Eder,

Instead of the command
GET /1/customers/$CID/sites

You should use the following command

GET /1/customers/$CID/sitelist
{
  "search": "tagIDs:< Unique identifier of the tag>"
}

To get the “Unique identifier of the tag” you can use the following command

GET /1/tags
{
  "customer": <Customer Id>
}

An explanation of the “sitelist” command can be found in the rapidM2M Playgorund. There is an exact description of the “Request Body” and the “Response Body”

You can also find a more detailed explanation for the “tags” command in the rapidM2M Playground.

Kind regards
Josef

Hello @Josef,
thanks for the answer. I tried it and I got the sites.

I tried it then with searching the notes of a site:

GET /1/customers/$CID/sitelist
{
“search”: “note:Altenmarkt,1”
}

which seems also to work. Just with this I got not only the site with the note: “Altenmarkt,1” but also the sites with: (done on server version 49v026)

  • “note”: “Altenmarkt,21”,
  • “note”: “Altenmarkt,31”,
  • “note”: “Altenmarkt,14”,

is there a way to tell the system it has to be an exact match?

Best regards
Johannes

Hello @Johannes_Eder,

currently there is no way to tell the system it has to be an exact match.

The comma acts as a separating symbol of two search terms.

The search terms are “or” linked.

This means, according to your example, you will receive a list of sites whose notes contain either the text “Altenmarkt” or “1”.

Kind regards
Microtronics Engineering