Send the Imp Agent URL to Imp

Is there a way to send the end part of this:

from the Agent to the IMP. I just want to send “nmxxxxxE9h-c”. Thanks.

You can get that part of the argent url with the following line of code:

agentID <- split(http.agenturl(), "/").top();

If you wanted to send it down to the device, you would just do something like this:

device.send("agentID", split(http.agenturl(), "/").top());

So simple :slight_smile: Thanks!

Will that string always be 12 characters long? Is it random and does it ever change for a single device?

The string is not guaranteed to be 12 characters long, however it will never change for a particular device (or rather, for a particular pair of device + account).