Integrating DoppelMe Creator



It is possible to integrate the DoppelMe editor directly within your website so that your users can create and modify their avatars without leaving your site. Below is an example written in PHP, but you can interact with the DoppelMe engine from almost any language.

Getting Started

To get started you should download the doppelme library and import it into your application code. You will also need a partner id and partner key if you haven't one already

Set up Editor

Import the DoppelMe Library and add your partner credentials
<?php require_once("doppelme.php"); ///Your partner credentials (put your own details in here) $doppelme_partner_id = 1; $doppelme_partner_key = 'abcdefg; ///Set up $doppelme_api = new DoppelMe($doppelme_partner_id, $doppelme_partner_key);
Carrying on, we query the api to get a validation key and use this to authenticate and set-up the editor via an iframe
///Your user's unique id (note that if your user id is numeric, you should convert it to a string $my_user_id = '1'; ///Get avatar details for your user $details = $doppelme_api->get_user_details($my_user_id); $status = $details['StatusCode']; if ($status != 0) { ///user does not have an avatar, so redirect them to a page where they can create one. header( 'Location: ./create.php' ); } $validation_key = $details['ValidationKey']; $doppelme_key = $details['DoppelMeKey']; $callback_url = "http://localhost/done.php?key=" . $doppelme_key; $language = 'EN'; $editor_url = "http://api.doppelme.com/partner/partner_validate.asp?pid=%d&puid=%s&validkey=%s&callback=%s&lang=%s"; $editor_url = sprintf($editor_url, $doppelme_partner_id, $my_user_id, $validation_key, $callback_url, $language); ?> <iframe src="<?php echo @$editor_url; ?>" style="position:absolute;overflow:hidden;width:660px;height:450px;border: 0;border-collapse: collapse;margin: 0 auto;" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" vspace="5" hspace = "0"></iframe>


Additional Options

By default, the creator is presented in the English language. You can offer your users the avatar creator in different languages by supply the language code as part of the iframe querystring (see above).
The list of currently supported languages is given below. If you require support for additional languages, please let us know.

Supported Languages
LanguageCode
DanishDA
EnglishEN
DutchNL
RussianRS
SlovakSI
Copyright © 2006-2017 DoppelMe. All rights reserved.