This topic has 2 replies, 3 voices, and was last updated 9 years by Radu.

  • Author
  • #153288
     volume4volume
    Participant

    Hello,  How can I sync my users from my website to my app? I’m using Appypie and they offer a AJAX code and a PHP code?

     

     

    COPY CODE
    			$apdata["apiKey"] = "YOUR_API_KEY";
    					$apdata["name"] = "zak";
    					$apdata["email"] = "test@gmail.com";
    					$apdata["password"] = "1234567";
    					$apdata["phone"] = "9999556644";
    					$apdata["passwordType"] = "";
    					$ch = curl_init("http://snappy.appypie.com/api/v1/register.php?format=json");
    					curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
    					curl_setopt($ch, CURLOPT_POSTFIELDS, $apdata);
    					curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    					$result = curl_exec($ch);
    					echo $result;
    					
    Json Request URL
    http://snappy.appypie.com/api/v1/register.php?format=json

    Json Response

    COPY CODE
    {"successCode":"200","message":"Registered successfully"}



    XML Request URL
    http://snappy.appypie.com/api/v1/register.php?format=xml

    XML Response

    COPY CODE
    <!--?xml version="1.0" encoding="UTF-8"?-->
    						<response>
    						<successcode>200</successcode>
    						<message>Registered successfully</message>
    						</response>						
    
    or
    
    
    COPY CODE
    $.ajax({
    	url: "http://snappy.appypie.com/api/v1/register.php?format=json",
    	data : {
    		apiKey:'YOUR_API_KEY',
    		name:'Zak',
    		email:'test@gmail.com',
    		password:'12345678',
    		phone:'1234567895',
    		passwordType:'',
    	},
    	type : "POST",
    	success : function(r) 
    		{
    		console.log(r);
    		}
    	});
    Json Request URL
    http://snappy.appypie.com/api/v1/register.php?format=json

    Json Response

    COPY CODE
    {"successCode":"200","message":"Registered successfully"}



    XML Request URL
    http://snappy.appypie.com/api/v1/register.php?format=xml

    XML Response

    COPY CODE
    <!--?xml version="1.0" encoding="UTF-8"?-->
    <response>
    <successcode>200</successcode>
    <message>Registered successfully</message>
    </response>
    COPY CODE
     
    #153433
     Laura
    Moderator
    Not marked as solution
    #153563
     Radu
    Moderator
    Not marked as solution
Viewing 3 posts - 1 through 3 (of 3 total)

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?