P
P
Pan Propan2015-05-26 11:30:03
API
Pan Propan, 2015-05-26 11:30:03

How to create a user on the portal, via the API?

The API describes how to create a user with a request.
My portal has an address - localhost
How do I correctly write a Post-request to programmatically create a user??

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pan Propan, 2015-05-26
@mgis

In the most elementary case, it will be like this, but this is only authorization

<?php
  if( $curl = curl_init() ) {
    curl_setopt($curl, CURLOPT_URL, 'http://192.168.1.221/API/2.0/AUTHENTICATION');
    curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
    curl_setopt($curl, CURLOPT_POST, true);
    curl_setopt($curl, CURLOPT_POSTFIELDS, "userName=********@mail.ru&password=********");
    $out = curl_exec($curl);
    echo $out;
    curl_close($curl);
  }
?>

as a result I receive from the server
Now we need to pass the parameters described in the API to the request .
Please tell me if there are examples similar to mine. I can't do it myself

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question