[Spce-user] Bulk addition of Subscriber Numbers to 1 single subscriber

Andreas Granig agranig at sipwise.com
Wed Feb 4 06:41:50 EST 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The URLs are obviously wrong, would be
https://fqdn:1443/api/subscribers/100.

Andreas

On 02/04/2015 12:38 PM, Andreas Granig wrote:
> Hello Marc,
> 
> On 02/03/2015 05:41 PM, Marc Storck wrote:
>> From the REST API Documentation I’m not sure how to do that 
>> exactly.
> 
>> Do I have to update the whole array for “alias_numbers” or do I 
>> have to update the whole subscriber array?
> 
> Let's assume your subscriber id is 100, then you've two choices:
> 
> 1. you fetch the resource via /api/subscribers/100 and modify the 
> whole resource by adding the full array of alias_numbers, then do
> a PUT with application/json on the URL with the full info.
> 
> $ export APIUSER="administrator:administrator" $ ngcp-api-get
> https://fqdn:1443/subscribers/100 -> modify the result here e.g. in
> a local file /tmp/sub.txt $ ngcp-api-put
> https://fqdn:1443/subscribers/100 < /tmp/sub.txt
> 
> 2. modify the fields in the resource individually via PATCH by
> sending a proper application/json-patch+json body.
> 
> $ export APIUSER="administrator:administrator" $ echo
> "[{"op":"add", "path":"/alias_numbers", "value": [{"cc":"12", 
> "ac":"34","sn":"567890"},{"cc":"12", 
> "ac":"34","sn":"567891"},{"cc":"12", "ac":"34","sn":"567892"}]}]"
> | ngcp-api-patch https://fqdn:1443/subscribers/100
> 
> or something like this. Untested, so might have syntax errors, but 
> that's basically the way to go to do it via the command line. Any 
> programmatical approach looks pretty much similar.
> 
> Andreas _______________________________________________ Spce-user
> mailing list Spce-user at lists.sipwise.com 
> https://lists.sipwise.com/listinfo/spce-user
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.14 (GNU/Linux)

iQIcBAEBAgAGBQJU0gV+AAoJEO/orXqLYCcEThEP/3xuealmK9Ns1sDT0J0p9ow6
BwRB9JTxFJOZ0gVh8GVAoJiHX5GG72bW7kZ6ZjVvLI0pVfqeD1jeqKJiUfPwmjCq
UCTjkAhVkHfIx9XJtrqO1xA+5XzTiPYrzc6eubLDSBgZH7JUgX4wLnfbexYaUbhA
4JBmMjafHS3wKn3T2wtcPwahPdLq2Uq9NNT31jimOjVfCx02uG8dmD9mZQv71qLO
I/1vggtu5/VwHgQNzwF0pJqcxzX7VObfptgiBJ910EsMxkU4Ed1cD3gv+ac3/rel
R7mVHW0CSVoNn0jHqZNE+rHwHJV3BlUneGqXsZhBlW6S9l0E8GfQUU82llk2l3xb
Jmh4PVW1axVYLf7vwgILWUEB7KLCz/7w7DLpEIPJ4e+MsqlhDFjrOJHRCngHoWGM
S3lac4uN3r3zmCjPECVpw2W9sMtpIVmsMO9y+aV0Rbv1mZFPAClrgDCmHKHfvzuD
IEgXjccpcLM5/OmG6tSzLvAMwwwHO43Z4YgAOo7lFuUFoHSqudC7CmzcNxgLm+wX
1oQPkkpx1Um8nGbr5t1/n4hgbpOLLkr18XaU9We1qoLJ5BdqztV4NYMvlN1BdHPs
DwT+IXoVQBoEh9GhRn+4r/UErFvnjPgSJwz8FtJAi4qugO7hfij88q04qYlpOwx7
Ba+KjTiP7mFxRT9PZ57F
=yyDL
-----END PGP SIGNATURE-----



More information about the Spce-user mailing list