Friday, November 15, 2013

Sending a PHP Curl requests to REST API of

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.

 $url = '';  
 $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_SSL_VERIFYPEER, false);  
 curl_setopt($rest,CURLOPT_RETURNTRANSFER, true);  
 $response = curl_exec($rest);  
 echo $response;  

Goto the Data Browser tab of the parse to find the saved data :)


  1. this code return only one record which first match
    i want get all data

  2. This code is used to insert data in Parse, Not to retrieve data.

  3. Great work.

    I just have few question. How are that data being stored? Why the url is $url = '';

  4. Hi thanks for your post but i have a problem

    I 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