Parse is an external BaaS (Backend as a service) provider.
The REST API of Parse lets you interact with Parse from anything that can send an HTTP request. Read more about Parse Rest API.
Follow the steps to create a Parse App and obtain AppId.
1. SignUp for Parse.
2. Move to Dashboard
3. Create a New App
4. Copy Application ID, Client Key and REST API Key to a text file.
Following is a sample code to send a Php Curl request to Rest API of Parse. Replace the placeholders with your Application ID and Rest API Key in the code and run it from a php server.
Goto the Data Browser tab of the parse to find the saved data :)
The REST API of Parse lets you interact with Parse from anything that can send an HTTP request. Read more about Parse Rest API.
Follow the steps to create a Parse App and obtain AppId.
1. SignUp for Parse.
2. Move to Dashboard
3. Create a New App
4. Copy Application ID, Client Key and REST API Key to a text file.
Following is a sample code to send a Php Curl request to Rest API of Parse. Replace the placeholders with your Application ID and Rest API Key in the code and run it from a php server.
<?php
$url = 'https://api.parse.com/1/classes/GameScore';
$appId = 'YOUR_APP_ID';
$restKey = 'YOUR_REST_KEY';
$headers = array(
"Content-Type: application/json",
"X-Parse-Application-Id: " . $appId,
"X-Parse-REST-API-Key: " . $restKey
);
$objectData = '{"name":"Adarsh", "age":"26"}';
$rest = curl_init();
curl_setopt($rest,CURLOPT_URL,$url);
curl_setopt($rest,CURLOPT_POST,1);
curl_setopt($rest,CURLOPT_POSTFIELDS,$objectData);
curl_setopt($rest,CURLOPT_HTTPHEADER,$headers);
curl_setopt($rest,CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($rest,CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($rest);
echo $response;
print_r($response);
curl_close($rest);
?>
Goto the Data Browser tab of the parse to find the saved data :)
this code return only one record which first match
ReplyDeletei want get all data
This code is used to insert data in Parse, Not to retrieve data.
ReplyDeleteSimple, nice, Thank you
ReplyDeleteGreat work.
ReplyDeleteI just have few question. How are that data being stored? Why the url is $url = 'https://api.parse.com/1/classes/GameScore';
Hi thanks for your post but i have a problem
ReplyDeleteI have user table in Data browser and also i successfully fetched the user objectId but problem is when I update Using Rest -master -key I am not able to update fields
can you help me
Thank you for sharing this information. This article is very interesting and useful. Keep up the good work!
ReplyDeleteThank you for sharing this information. This article is very interesting and useful. Keep up the good work!
ReplyDeleteشركة تنظيف كنب بالقطيف
شركة تنظيف مجالس بالقصيم
شركة تنظيف مجالس بالرس