Andy,
Our webservices api uses json-rpc version 2.0.
http://www.jsonrpc.org/specification
You can look at all Public functions in lib/pf/api.pm
To answer your question you would need to do this with two api calls.
First create the user
curl -H "Content-Type: application/json-rpc" -d '{"jsonrpc":"2.0",
"id":0, "method":"add_person" , "params" :
["pid","bob","email","testcurl@sample_domain.com"]}' localhost:9090
Then register the node for the user
curl -H "Content-Type: application/json-rpc" -d '{" jsonrpc":"2.0",
"id":0, "method":"register_node" , "params" :
["pid","bob","mac","01:02:03:04:05:06"]}' localhost:9090
James Rouzier
jrouz...@inverse.ca :: +1.514.447.4918 (x115) :: http://www.inverse.ca
Inverse inc. :: Leaders behind SOGo (http://www.sogo.nu) and PacketFence
(http://www.packetfence.org)
On 2015-07-24 6:50 AM, Andy A wrote:
Hi
I am trying to register a node using curl but I keep getting the same
exception. I would like to find a way to register / unregister node
without using the captive portal. If anyone has some different
suggestions on how to do that, that would be very helpful. I am using
the following curl request
curl -H "Content-Type: application/x-www-form-urlencoded"
—data-urlencode '{ "destination_url":"http://www.cnn.com
<http://www.cnn.com/>","by_email":"Sign Up",
"firstname":"testcurl","lastname":"curluser","email":"testcurl@sample_domain.com","aup_signed":"on"}'
https://guest.sample_domain.com/signup?mode=guest-register
I get the following error in the response.
Caught exception in
captiveportal::Controller::Signup->validateMandatoryFields "Can't use
an undefined value as an ARRAY reference at
/usr/local/pf/html/captive-portal/lib/captiveportal/PacketFence/Controller/Signup.pm
line 589."
Thanks.
------------------------------------------------------------------------------
_______________________________________________
PacketFence-devel mailing list
PacketFence-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/packetfence-devel
------------------------------------------------------------------------------
_______________________________________________
PacketFence-devel mailing list
PacketFence-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/packetfence-devel