Example Integration Code

Below are 4 example PHP files that illustrate how to integrate DoppelMe avatars within your website using the SOAP API. These are given for example only and no warranty is provided. These example are given in PHP - but the same prinicples can be applied to code in other languages/frameworks.

doppelme.php | profile_avatar.php | profile_avatar_create.php | profile_avatar_updated.php

Constants and Utility Functions

Include these constants and utility functions in any pages which make API calls.
//DoppelMe Constants
$DOPPELME_SITE        = "http://api.doppelme.com";
$DOPPELME_SERVICE        = "http://services.doppelme.com/partnerservice.asmx?WSDL";     
$DM_PARTNER_ID        = 1;  //put your partner id here
$DM_PARTNER_KEY        = "A";  //put your partner key here

//DoppelMe Functions

function TestSetup() {

    $client = new SoapClient( $DOPPELME_SERVICE , array('trace' => 1)  );     
    //echo "client:\n";

    //echo "\nAvailable methods:\n";

    echo "\n\nCurrent Version:\n";

function PartnerServiceCall($sURL, $sPARAMS) {
    $client = new SoapClient( $DOPPELME_SERVICE ); 
    $sReturnXML = $client->__soapCall( $sURL, $sPARAMS );
    return $sReturnXML;


//a very simple sanitizer function given here purely as an example.
//you should use your own more robust/complete sanitizer 
function CleanTaintedInput($sText) {

    $sClean = $sText;    
    $sClean = str_replace($sClean,"'","");
    $sClean = str_replace($sClean,";","");
    return $sClean;


Copyright © 2006-2018 DoppelMe. All rights reserved.