XenForo Why won't this add a user via the API?

P

PPC Coach

Guest
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' => 'testuser@example.com',
'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...