HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


OCP API Question

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#50618 (In Topic #11034)
Avatar

Community saint

Hey there ocProducts!! I had a peak around the API documentation, but did not see what I was looking for, so thought I'd ask: is there any way that the account/member creation process can be initiated via an API call? I have a form where a customer, on behalf of their customer, can request a license key. We are also creating support site accounts during this process by hand and I'd like to automate as much of that as I can. We approve every account, so security is not a huge concern in this instance.

TIA!

"no violence, no hate, no pain, no enemies
just peace, unity, tolerance and love" - The Beloved

OCP V7 | Advocating monetary reform - FreeOurMoney

Need OCP friendly hosting? Look no further:
Web Hosting, Reseller Hosting, and Dedicated Servers w/cPanel - Elief! - Official hosting partner for ocPortal.
Back to the top
 
Posted
Rating:
#50621
Avatar

The ocf_make_member function in ocf_members_action.php (load via require_code('ocf_members_action');.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#50623
Avatar

Community saint

Thanks Chris!

"no violence, no hate, no pain, no enemies
just peace, unity, tolerance and love" - The Beloved

OCP V7 | Advocating monetary reform - FreeOurMoney

Need OCP friendly hosting? Look no further:
Web Hosting, Reseller Hosting, and Dedicated Servers w/cPanel - Elief! - Official hosting partner for ocPortal.
Back to the top
 
Posted
Rating:
#54517
Avatar

Community saint

Wow, finally getting around to starting this project! ;-)

Chris, any way to call this file from a "nonOCPortal" server that will bypass the OCP authentication (I'm getting a 403 atm)? Using this API call would not be viewed as a security problem for us as we'll be manually activating the account.

Thanks!

"no violence, no hate, no pain, no enemies
just peace, unity, tolerance and love" - The Beloved

OCP V7 | Advocating monetary reform - FreeOurMoney

Need OCP friendly hosting? Look no further:
Web Hosting, Reseller Hosting, and Dedicated Servers w/cPanel - Elief! - Official hosting partner for ocPortal.
Back to the top
 
Posted
Rating:
#54518
Avatar

Community saint

LOL, nevermind...htaccess to the rescue! Added an Allow from to the existing .htaccess.

"no violence, no hate, no pain, no enemies
just peace, unity, tolerance and love" - The Beloved

OCP V7 | Advocating monetary reform - FreeOurMoney

Need OCP friendly hosting? Look no further:
Web Hosting, Reseller Hosting, and Dedicated Servers w/cPanel - Elief! - Official hosting partner for ocPortal.
Back to the top
 
Posted
Rating:
#54680
Avatar

Community saint

Hey Chris! Before I get too deep into this one, quick question for ya: will I be able to do something like the following with the OCP API?

Code

<?php
   $curl = curl_init();
   curl_setopt($curl, CURLOPT_URL,"http://10.1.1.11/webadmin/api/account_create.php");
   curl_setopt($curl, CURLOPT_POST, 1);
   curl_setopt($curl, CURLOPT_POSTFIELDS, "login=".urlencode($contact_email)."&password=".urlencode($last_name)."&first_name=".urlencode($first_name)."&last_name=".urlencode($last_name)."&organization=".urlencode($stripped_company_name)."&classification=user"."&ttl=".urlencode($expiry_date)."&description=Submitted via SugarCRM"."&email_address=".urlencode($contact_email));
   curl_exec ($curl);
   curl_close ($curl);
?>
This is the code I use to create accounts using our API for our product. During this same cycle, I'd aslo like to initiate the creation of an account in OCP.

TIA!

"no violence, no hate, no pain, no enemies
just peace, unity, tolerance and love" - The Beloved

OCP V7 | Advocating monetary reform - FreeOurMoney

Need OCP friendly hosting? Look no further:
Web Hosting, Reseller Hosting, and Dedicated Servers w/cPanel - Elief! - Official hosting partner for ocPortal.
Back to the top
 
Posted
Rating:
#54681
Avatar

No reason why not, it's just standard PHP code and I can't see any errors (like PHP notices) in there that ocPortal would drag out :).


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: