• If you need help or want to discuss things, you now can also join us on our Discord Server!
  • A first preview of the unlimited version of SinusBot can be found in the Upcoming Changes thread. A version for Windows will follow, but we don't have a release date, yet.

(NOT BUG) 'name' or 'password' not set

Status
Not open for further replies.

SUNSHINE

New Member
Hi,

I have a problems with my API system. I try to create a new user account with this script :

Code:
$data = array("name" => "test", "password" => "testpass", "privileges" => 2147483647);                                                                    
$data_string = json_encode($data);                                                                                  
$token_id = "uQHwuHsiaSI6IjIzNzQ5YzYzLWY1N2MtNGU2Ni05YzM0LWZiZmRhZTg4YzdlOSIsImIiOiI0Yzg0YWE5My1hYTcwLTRlNGItYjIzZi02OTZjOTBjNGRlYWMiLCJ1IjoiYWRtaW4iLCJ0IjoxNDYzMzkxOTQ2LCJzIjoiZTA3ZjdmMjM2ODgxMjkyMzRjODIwMjQ4MTM2MGQwOGQxMWRiZWFiN2M0M2IxY2MyYzgzODdhOThmNjBmNmZmMyJ9";                    
                   
$ch = curl_init('http://149.202.46.113:4587/api/v1/bot/users');                                                                      
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");                                                                    
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);                                                                  
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);                                                                      
curl_setopt($ch, CURLOPT_HTTPHEADER, array(                                                                      
    "Authorization: bearer $token_id",                                                                              
    'Content-Type: application/json',                                                                                
    'Content-Length: ' . strlen($data_string))                                                                      
);                                                                                                                  
                                                                                                                     
$result = curl_exec($ch);
print_r($result);

he result to an error : {"success":false,"code":8081,"error":"'name' or 'password' not set"}

Why ? My script looks good.
 

mxschmitt

Moderator
Staff member
is awesome!
V.I.P.
is uber awesome!
Contributor
Insider
You have already a thread opened with that kind of topic. That isn´t a bug. Just check the API Calls of the normal webinterface, there should you see everything, what you need-
 

SUNSHINE

New Member
"Just check the API Callsof the normal webinterface"

Guys If I post here it's because I have already checked the API webinterface... I have read your documentation I have maked my script, result : bugged.
So can you explain how can I debug this ?
 
Status
Not open for further replies.
Top