[Spce-user] add a lot of alias-numbers [SOLVED]

fry spce at friibii.ch
Tue Nov 18 12:25:36 EST 2014


Hi,

PATCH was perfectly okey - as I won't add a new user - but add lots of 
alias-numbers..
bur of the syntax was not perfect, but now i found it.. importet over 
150 alias-numbers i one command.. really nice.. ;-)

curl -i -X PATCH -H 'Connection: close' -H 'Content-Type: 
application/json-patch+json' -H 'Prefer: return=minimal' --insecure 
'https://URL:1443/api/subscribers/SUBSCRIBERNUMBER' --data-binary '[ { 
"op": "add", "path": "/alias_numbers", "value" : [ { "cc" : 41, "ac" : 
44, "sn" : 2111120 }, {"ac" : 44, "cc" : 41, "sn" : 2111122 } , 
....[LOTS MORE]....] } ]' -u USER:PWD

only you have to take care is that you override existing alias_numbers..

thnaks for any advice hope this helps anyone other,
fry



Am 18.11.2014 um 18:05 schrieb Andreas Granig:
> Hi,
>
> On 11/18/2014 04:30 PM, Daniel Grotti wrote:
>> Hi,
>> I would use the PUT, not PATCH
>>
>> Example
>> curl -i -X PUT -H 'Connection: close' -H 'Content-Type:
>> application/json' -H 'Prefer: return=minimal' --cert
>> NGCP-API-client-certificate.pem --cacert ca-cert.pem
>> 'https://example.org:1443/api/subscribers/2' --data-binary '{
>> "customer_id" : 4, "domain_id" : 4, "password" : "test", "username" :
>> "test" }'
> Well, PATCH is perfectly fine to modify only a single field. Please
> check the /var/log/ngcp/api.log for the error. 500 shouldn't be returned
> in any case as it's only emitted on internal errors, not sure what the
> problem is as I can't reproduce it over here.
>
> Andreas
> _______________________________________________
> Spce-user mailing list
> Spce-user at lists.sipwise.com
> https://lists.sipwise.com/listinfo/spce-user




More information about the Spce-user mailing list