Hi James.
Thanks. Your reply got lost in all the other replies. That is exactly what I
needed.Cheers for example curl requests as well.
So basically after creating a user and registering a node this would do two
things (that I am expecting)
1. Create a local user account (with temp password) and an email being sent to
the testcurl@sample_domain.com with the details for activation. This of course
is based on whether there is a config setting of creating a local account.2.
Enable a temporary internet access (of 10 minutes or whatever is configured)
for the user activate their account.
Is that right?
Thanks
Date: Fri, 24 Jul 2015 12:09:35 -0400
From: [email protected]
To: [email protected]
Subject: Re: [PacketFence-devel] Register a node using a curl
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
[email protected] :: +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","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
[email protected]
https://lists.sourceforge.net/lists/listinfo/packetfence-devel
------------------------------------------------------------------------------
_______________________________________________
PacketFence-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/packetfence-devel
------------------------------------------------------------------------------
_______________________________________________
PacketFence-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/packetfence-devel