[Spce-user] REST patch customercontact does not work...
Walter Klomp
walter at myrepublic.net
Thu Feb 23 10:57:23 EST 2017
Hi guys,
We’re trying to get REST interface to work in our system. (running mr4.5.1)
Why does this fail ? Anything more we can do to debug?
curl -i -X PATCH --user ’ossuser:xxx' -H 'Connection: close' -H 'Content-Type:application/json-patch+json' 'https://sip.server.address:1443/api/customercontacts/6567' --data-binary '[ { "op": "replace", "path": "/firstname", "value": "Jason" }, { "op": "replace", "path": "/lastname", "value": "THANT" }, { "op": "replace", "path": "/mobilenumber", "value": "6275599222" }, { "op": "replace", "path": "/phonenumber", "value": "668515222" }, { "op": "replace", "path": "/faxnumber", "value": "NoFax222" }, { "op": "replace", "path": "/email", "value": "kzthant at MyCompany.net" }, { "op": "replace", "path": "/street", "value": "ORiordan Street" }, { "op": "replace", "path": "/company", "value": "MyCompany" }, { "op": "replace", "path": "/city", "value": "Sydney" } ]'
This is what I see in the log:
Feb 23 14:33:46 sipwise ngcp-panel: INFO: IP=xx.xx.xx.xx CALLED=API[PATCH]/api/customercontacts/6567 TX=14A5CD28A1B708D0 USER=ossuser DATA={} MSG="" LOG="[ { "op": "replace", "path": "/firstname", "value": "Jason" }, { "op": "replace", "path": "/lastname", "value": "THANT" }, { "op": "replace", "path": "/mobilenumber", "value": "6596275599222" }, { "op": "replace", "path": "/phonenumber", "value": "6568151515222" }, { "op": "replace", "path": "/faxnumber", "value": "NoFax222" }, { "op": "replace", "path": "/email", "value": "kzthant at myemail.address" }, { "op": "replace", "path": "/street", "value": "ORiordan Street" }, { "op": "replace", "path": "/company", "value": "MyCompany" }, { "op": "replace", "path": "/city", "value": "Sydney" } ]"
Feb 23 14:33:46 sipwise ngcp-panel: ERROR: IP=xx.xx.xx.xx CALLED=API[PATCH 200]/api/customercontacts/6567 TX=14A5CD28A1B708D0 USER=ossuser DATA={} MSG="" LOG="Caught exception in NGCP::Panel::Controller::API::CustomerContactsItem->PATCH "Use of uninitialized value in numeric ne (!=) at /usr/share/perl5/NGCP/Panel/Role/API/CustomerContacts.pm line 102, <$fh> line 1.""
Feb 23 14:33:46 sipwise ngcp-panel: INFO: IP=xx.xx.xx.xx CALLED=API[PATCH 500]/api/customercontacts/6567 TX=14A5CD28A1B708D0 USER=ossuser DATA={} MSG="" LOG="{"message":"Internal Server Error","code":"500”}"
I checked the CustomerContacts.pm line 102 and it seems something in this line:
if($old_resource->{reseller_id} != $resource->{reseller_id}) {
is undefined?
Same account has no problem patching subscriberpreferences etc…
Also all the fields we are trying to “patch” do exist for this contact and are valid values.
Thanks for your suggestions.
Warmest Regards
Walter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sipwise.com/mailman/private/spce-user_lists.sipwise.com/attachments/20170223/41028d6f/attachment.html>
More information about the Spce-user
mailing list