RSS Feed/News Why won't this add a user via the API?

Status
Not open for further replies.

ENXF NET

Administrator
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P.S Member
S.V.I.P Member
V.I.P Member
Collaborate
Registered
Joined
Nov 13, 2018
Messages
24,662
Points
823

Reputation:

Here's my code:
<?php
define('XENFORO_API_KEY', 'my_API_key_here');
define('XENFORO_BASE_URL', 'https://members.printondemandcoach.com/api');

$url = XENFORO_BASE_URL . '/users';
$data = [
'username' => 'testuser',
'email' => '[email protected]',
'user_group_id' => 2
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, [...
Click to expand...

Read more

Continue reading...
 
Status
Not open for further replies.
Top