php - Want to manage mongoldb user on CodeIgniter using Parse Rest API -


database: mongodb backend framework: codeigniter

want manage default user table backend. using parserestapi know mongodb not allow update user without session. there way can manage users created app , delete/create new users.

yes can parse rest api

for exmaple delete user: use delete http verb , call that:

note: need pass session token or master key

 curl -x delete \   -h "x-parse-application-id: yourappid" \   -h "x-parse-rest-api-key: yourapikey" \   -h "x-parse-session-token: sessiontoken" \   -h "x-parse-master-key: yourmasterkey" \   https://api.example.com/1/users/<objectid> 

in php can write:

$ch = curl_init('https://api.example.com/1/users/<objectid>');                                                                       curl_setopt($ch, curlopt_customrequest, "delete");                                                                       curl_setopt($ch, curlopt_returntransfer, true);                                                                       curl_setopt($ch, curlopt_httpheader, array(                                                                               'content-type: application/json',                                                                                     'x-parse-application-id: yourappid',     'x-parse-rest-api-key: yourapikey',      'x-parse-master-key: yourmasterkey'                                                                  );                                                                                                                     $result = curl_exec($ch); 

to create user call api (i use curl example)

        curl -x post \         -h "x-parse-application-id: youappid" \         -h "x-parse-rest-api-key: yourapikey" \         -h "content-type: application/json" \         -d '{ "objectid": "", "updatedat": "", "createdat": "", "name": "john doe", "pass": "toto42" }' \         https://api.example.com/1/classes/user/ 

Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -