[Spce-user] 500 Server Error when adding customer via REST

Weigelt, Martin m.weigelt at m.ccgmbh.de
Mon Sep 22 09:21:18 EDT 2014


Hi,

I'm trying to add a customer via REST.  As answer I always get "500 internal Server error". Tried with 3.3.2 and 3.4.1.

Used curl:
curl --user administrator:... -k -i -X POST -H 'Connection: close' -H 'Content-Type: application/json' 'https://127.0.0.1:1443/api/customers/' --data-binary '{ "billing_profile_id" : 1, "contact_id" : 2, "status" : "active" }'
HTTP/1.1 500 Internal Server Error
Server: nginx
Date: Mon, 22 Sep 2014 13:10:45 GMT
Content-Type: application/json
Content-Length: 49
Connection: close
Set-Cookie: ngcp_panel_session=3c1540e6673de1a30541e38435a5c063ee42197a; path=/; expires=Mon, 22-Sep-2014 14:10:45 GMT; HttpOnly
X-Catalyst: 5.90042

{"message":"Internal Server Error","code":"500"}


Output from oss.log:
Sep 22 15:13:11 xxx /usr/share/ngcp-panel/ngcp_panel_fastcgi.pl: *** Root::auto called
Sep 22 15:13:11 xxx /usr/share/ngcp-panel/ngcp_panel_fastcgi.pl: ++++++ Root::auto unauthenticated API request
Sep 22 15:13:11 xxx /usr/share/ngcp-panel/ngcp_panel_fastcgi.pl: ++++++ Root::auto API request with http auth
Sep 22 15:13:11 xxx /usr/share/ngcp-panel/ngcp_panel_fastcgi.pl: ++++++ admin 'administrator' authenticated via api_admin_http
Sep 22 15:13:11 xxx /usr/share/ngcp-panel/ngcp_panel_fastcgi.pl: API function 'api/customers/' called by 'administrator' ('admin') from host '::ffff:127.0.0.1' with method 'POST' and params '' and body '{ "billing_profile_id" : 1, "contact_id" : 2, "status" : "active" }'
Sep 22 15:13:11 xxx /usr/share/ngcp-panel/ngcp_panel_fastcgi.pl: Caught exception in NGCP::Panel::Controller::API::Customers->POST "Use of uninitialized value $product_class in string eq at /usr/share/perl5/NGCP/Panel/Controller/API/Customers.pm line 184, <$fh> line 1."
Sep 22 15:13:11 xxx /usr/share/ngcp-panel/ngcp_panel_fastcgi.pl: error 500 - Internal Server Error
Sep 22 15:13:11 xxx /usr/share/ngcp-panel/ngcp_panel_fastcgi.pl: API function 'api/customers/' generated response with code '500' and body '{"message":"Internal Server Error","code":"500"}#012'

...


Just found out: after adding "product" : "sipaccount" as additional parameter it's working. But it's not documented in the API.



--
Mit freundlichen Grüßen,
Best regards,

Martin Weigelt
Communication Concept GmbH
Voice and Data
Theklaer Strasse 42
04347 Leipzig

Telefon: +49 341 23405 211
Fax:     +49 341 23405 190
Mobile:  +49 151 24038213
Mail:    m.weigelt at ccgmbh.de


Communication Concept GmbH

Registergericht: Amtsgericht Leipzig
Registernummer:  HR 6383
Geschäftsführer: Rainer Strehle,Torsten Below, André Mamitzsch, Falk Assel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sipwise.com/mailman/private/spce-user_lists.sipwise.com/attachments/20140922/5898474b/attachment.html>


More information about the Spce-user mailing list