Question: For now I can send a notification to a single device using the curl command: 

```
curl --header "Authorization: key=AAAxxxxxE4:xxxxxxxuXog" --header Content-Type:"application/json; application/x-www-form-urlencoded;charset=UTF-8" -d '{"to":"DeviceToken","notification":{"title":"Test","body":"Test Message","icon":"icon-192x192.png"}}' https://fcm.googleapis.com/fcm/send 

```

This works great. Now I try to scale the number of recipients by using the topic functionality.

I tried to add a device to the topic "svp" by using the curl command:

```
curl --header "Authorization: key=AAAxxxxxE4:xxxxxxxuXog" --header Content-Type:"application/json" https://iid.googleapis.com/iid/v1/DeviceToken/topics/svp

```

Here I get the error message:

```
{"error":"InvalidToken"}

```

But I'm sure, both, the Authorization key and the token are correct. (I still can send notifications with it).

Can anybody help me to find the solution for my problem?

Answer: 
I think you missed the `rel` in your cURL request, between the token and the topic name. As seen in the [Instance ID docs](https://developers.google.com/instance-id/reference/server#create_a_relation_mapping_for_an_app_instance), the format should be:

```
https://iid.googleapis.com/iid/v1/IID_TOKEN/rel/topics/TOPIC_NAME

```
For some reason, <https://iid.googleapis.com/iid/v1/IID_TOKEN/rel/topics/TOPIC_NAME> did not work for me. It seemed to me that I was doing everything correctly but what I decided to do was to try the equivalent of that by using <https://iid.googleapis.com/iid/v1:batchAdd> and sending only one token:

```
$curlUrl = "https://iid.googleapis.com/iid/v1:batchAdd";
$mypush = array("to"=>"/topics/toronto", "registration_tokens"=>array("acwAw4F8b0W:AMA91bEAKsN1aGjMm5xsobxBHxbYZLfioTPMEIN90njdiK5C2MnOYF4NcOy6ot6BFanMTBIoKRGcyev2RJuydGWt1XHwsniNZ6h8Pjvn9Fqth-Mqgj_5-YN9pt_nMAtgG8blc5bodWyA"));
$myjson = json_encode($mypush);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $curlUrl);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
curl_setopt($ch, CURLOPT_POST, True);
curl_setopt($ch, CURLOPT_POSTFIELDS, $myjson);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json', 'Authorization:key=[My authorization key]'));
//getting response from server
$response = curl_exec($ch);

```

I could add the token to the topic successfully. What was returned was this:

```
{"results":[{}]}

```

But then I went to confirm to the topics by using <https://iid.googleapis.com/iid/info/IID_TOKEN> that the token had been successfully added to the topic the way I wanted it and yes, everything worked correctly for me using <https://iid.googleapis.com/iid/info/IID_TOKEN>. So if you are having problems with <https://iid.googleapis.com/iid/v1/IID_TOKEN/rel/topics/TOPIC_NAME>, you can simply use <https://iid.googleapis.com/iid/v1:batchAdd> the way I did it.