Services & API

Avatar for programmers and developers in the web environment through the programming interface allows the use of avatar software as part of their program. If you are a game or software developer, you can easily create your favorite avatar and display it in your software or game by using a few lines of code.

How To

Leave The Production And Presentation
Of Avatars To Us

After registration and receiving the avatarz.top service subscription, you can register your website or software through the site dashboard. After registering each software, a unique Token code is generated for the registered site and it is provided to you that you must use this Token to access the avatar maker.

Figure 1 - API Dashboardtra
Figure 1 - API Dashboard
Figure 2 - Add site
Figure 2 - Add site
Figure 3 - Get Token
Figure 3 - Get Token

The methods of communicating your software or game and avatar are as follows:

  • Avatar maker calls by your users from your software: To add the possibility of recording a cartoon or avatar image to users, the developer must direct users to the avatar maker page through a specific link.

Sample link address:

https://www.avatarz.top/generator?rt=[avatarMeToken]&ut=[playerToken]&avatar=[avatarCode]&theme=[themeCode]
    

avatarMeToken: In this part of the address, you must enter the Token that you received from this site according to Figure 3.

playerToken: Each user in your application must have their own unique ID or Token. In order for the user to return to the software after the user returns to your software, you can be sure that the work coordination is returned and the user of your site is sure, whatever value you send to us, the avatar will send when the user returns to your site.

avatarCode: This is the amount of user avatar code stored on your site. Leave this value blank if you have not yet saved a code for your user avatar.

themeCode: If you want the avatar creator to look more like your software or game, you can choose the avatar theme to display to your users. If your software uses different themes such as day and night mode, you can direct users to the avatar maker depending on the theme selected in your software or game. Empty this value will display the avatar maker with the default theme.
Values of various themes: dark, light

Link sample in HTML:

<a href="https://www.avatarz.top/generator?rt=[avatarMeToken]&ut=[playerToken]&avatar=[avatarCode]">
Edit Avatar
</a>
    
Note that there is no need to open the avatar in a new tab of the browser, the user will be returned to the return address after filling in the changes, which you fill in the form in Figure 2.
Sample link in JavaScript:

window.location = 'https://www.avatarz.top/generator?rt=[avatarMeToken]&ut=[playerToken]&avatar=[avatarCode]';
    

  • User return from Avatar to your software: After making changes to their avatar, the user will return to the return address registered in the dashboard as shown in Figure 2 by pressing the save button.
    The avatar maker returns the values of the user-selected avatar code to your site as a QueryString along with the registered return address.

Example:

For example, your site or game is located at http://sample.com/.
The return address you entered in the dashboard for your site is http://sample.com/save_avatar/.
The address you are redirecting to the avatar maker is https://www.avatarz.top/generator?rt=XXXX&ut=player01.
The URL that the user returns to your site from the avatar maker will be http://sample.com/save_avatar/?ut=player01&avatar=00010100030502.

You must identify the user on the return page if you are logged in. For security, you must match your playerToken submission returned by the autoresponder to the user you identified on the site, and if confirmed, the unique code of this user. Save the avatar value sent in QueryString to the user in the database.

Note that only needs to save this code for the user in their software and Avatar does not store any data from your user such as playerToken or even the avatar code and you are responsible for saving this amount.

The number of times users use Avatar to create the image they want and the number of images they create is free and is not recorded in your site requests.

  • Display user avatars in your application: To display an avatar created by the user on your website or game, you must enter the image address according to the following template along with the user avatar code that you have saved on your site:

Example:

https://www.avatarz.top/avatars/[avatarCode]
    

avatarCode: The code stored on your site during the process of returning the user from Avatar to your site or software.

Sample display in HTML:

<img src="https://www.avatarz.top/avatars/[avatarCode]">
    

These requests will be validated by the referal URL of the request. But you can also validate your request, by adding your validation token in the request header:


token: [YOUR_VALIDATION_TOKEN]
    

The number of requests calculated by your site is the number of requests to display the avatar image of users on your website. Using this system, the volume of load and space consumption of bandwidth and disk by users' avatar images will be the responsibility of our servers.

Daily API Performance Report

You can see the amount of requests for each of your game or software projects on the report page in the dashboard of this site.

Figure 4 - Report page
Figure 4 - Report page

If you do not have a subscription yet, you can start receiving subscriptions for avatarz.top services and from today, you can use your game and software to display avatars for the user image. If you still need more evidence to decide and use our avatar maker in your software, contact us and request a demo.