Change site for user's WebRTC phone to use the new one
For #2 I need the site ID. I'm hoping there's some way to just get the ID returned from the response of #1 to feed into the command at #2. But it looks like potentially I need to add a new query to something like /api/v2/telephony/providers/edges/sites using the site plain-text name and extract the ID from there.
When you create the new site the CLI should return the response object containing the ID of the new site. You can pipe the response object to something like jq to extract the site ID.
If using powershell you can use format like example below.
I have used this style elsewhere, piped an input to GC command and the response is captured with pipe to Set-Variable.
In my example, the variable $json has the Did json body required to create entry. The response from that (not surprisingly in example), is stored in the $response variable (you do not put the $ on the Set-Variable command though)
A variation is below to get a particular user json, strip down to just id and name, and store that in $response.
If doing this version the gc command has to be first in pipe list and surrounded by parentheses