Adorable Avatars

Avatar

avatar

The simplest way is to create an image tag that points to our service (specifying your identifier), but you can also browse to your avatar URL and save the image to your computer.


/avatars/{size}/{identifier}.png

Usage and SDK Samples

curl -X GET "https://api.apieco.ir/adorable-avatars/avatars/{size}/{identifier}.png"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.AvatarApi;

import java.io.File;
import java.util.*;

public class AvatarApiExample {

    public static void main(String[] args) {
        
        AvatarApi apiInstance = new AvatarApi();
        String apiecoKey = apiecoKey_example; // String | 
        String size = size_example; // String | 
        String identifier = identifier_example; // String | 
        try {
            File result = apiInstance.avatar(apiecoKey, size, identifier);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AvatarApi#avatar");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.AvatarApi;

public class AvatarApiExample {

    public static void main(String[] args) {
        AvatarApi apiInstance = new AvatarApi();
        String apiecoKey = apiecoKey_example; // String | 
        String size = size_example; // String | 
        String identifier = identifier_example; // String | 
        try {
            File result = apiInstance.avatar(apiecoKey, size, identifier);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AvatarApi#avatar");
            e.printStackTrace();
        }
    }
}
String *apiecoKey = apiecoKey_example; // 
String *size = size_example; // 
String *identifier = identifier_example; // 

AvatarApi *apiInstance = [[AvatarApi alloc] init];

[apiInstance avatarWith:apiecoKey
    size:size
    identifier:identifier
              completionHandler: ^(File output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var AdorableAvatars = require('adorable_avatars');

var api = new AdorableAvatars.AvatarApi()

var apiecoKey = apiecoKey_example; // {String} 

var size = size_example; // {String} 

var identifier = identifier_example; // {String} 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.avatar(apiecoKey, size, identifier, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class avatarExample
    {
        public void main()
        {
            
            var apiInstance = new AvatarApi();
            var apiecoKey = apiecoKey_example;  // String | 
            var size = size_example;  // String | 
            var identifier = identifier_example;  // String | 

            try
            {
                File result = apiInstance.avatar(apiecoKey, size, identifier);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AvatarApi.avatar: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\Api\AvatarApi();
$apiecoKey = apiecoKey_example; // String | 
$size = size_example; // String | 
$identifier = identifier_example; // String | 

try {
    $result = $api_instance->avatar($apiecoKey, $size, $identifier);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AvatarApi->avatar: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::AvatarApi;

my $api_instance = WWW::SwaggerClient::AvatarApi->new();
my $apiecoKey = apiecoKey_example; # String | 
my $size = size_example; # String | 
my $identifier = identifier_example; # String | 

eval { 
    my $result = $api_instance->avatar(apiecoKey => $apiecoKey, size => $size, identifier => $identifier);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AvatarApi->avatar: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.AvatarApi()
apiecoKey = apiecoKey_example # String | 
size = size_example # String | 
identifier = identifier_example # String | 

try: 
    api_response = api_instance.avatar(apiecoKey, size, identifier)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AvatarApi->avatar: %s\n" % e)

Parameters

Path parameters
Name Description
size*
String
Required
identifier*
String
Required
Header parameters
Name Description
apieco-key*
String
Required

Responses

Status: 200 - Successful


createFace

Totally! There's now a way for you to build your avatar from scratch! Requests of the form /avatars/face/:eyes/:nose/:mouth/:color will build an avatar out of those specified pieces.


/avatars/face/{eyes}/{nose}/{mouth}/{color}

Usage and SDK Samples

curl -X GET "https://api.apieco.ir/adorable-avatars/avatars/face/{eyes}/{nose}/{mouth}/{color}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.AvatarApi;

import java.io.File;
import java.util.*;

public class AvatarApiExample {

    public static void main(String[] args) {
        
        AvatarApi apiInstance = new AvatarApi();
        String apiecoKey = apiecoKey_example; // String | 
        String eyes = eyes_example; // String | 
        String nose = nose_example; // String | 
        String mouth = mouth_example; // String | 
        String color = color_example; // String | 
        try {
            File result = apiInstance.createFace(apiecoKey, eyes, nose, mouth, color);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AvatarApi#createFace");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.AvatarApi;

public class AvatarApiExample {

    public static void main(String[] args) {
        AvatarApi apiInstance = new AvatarApi();
        String apiecoKey = apiecoKey_example; // String | 
        String eyes = eyes_example; // String | 
        String nose = nose_example; // String | 
        String mouth = mouth_example; // String | 
        String color = color_example; // String | 
        try {
            File result = apiInstance.createFace(apiecoKey, eyes, nose, mouth, color);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AvatarApi#createFace");
            e.printStackTrace();
        }
    }
}
String *apiecoKey = apiecoKey_example; // 
String *eyes = eyes_example; // 
String *nose = nose_example; // 
String *mouth = mouth_example; // 
String *color = color_example; // 

AvatarApi *apiInstance = [[AvatarApi alloc] init];

[apiInstance createFaceWith:apiecoKey
    eyes:eyes
    nose:nose
    mouth:mouth
    color:color
              completionHandler: ^(File output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var AdorableAvatars = require('adorable_avatars');

var api = new AdorableAvatars.AvatarApi()

var apiecoKey = apiecoKey_example; // {String} 

var eyes = eyes_example; // {String} 

var nose = nose_example; // {String} 

var mouth = mouth_example; // {String} 

var color = color_example; // {String} 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.createFace(apiecoKey, eyes, nose, mouth, color, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class createFaceExample
    {
        public void main()
        {
            
            var apiInstance = new AvatarApi();
            var apiecoKey = apiecoKey_example;  // String | 
            var eyes = eyes_example;  // String | 
            var nose = nose_example;  // String | 
            var mouth = mouth_example;  // String | 
            var color = color_example;  // String | 

            try
            {
                File result = apiInstance.createFace(apiecoKey, eyes, nose, mouth, color);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AvatarApi.createFace: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\Api\AvatarApi();
$apiecoKey = apiecoKey_example; // String | 
$eyes = eyes_example; // String | 
$nose = nose_example; // String | 
$mouth = mouth_example; // String | 
$color = color_example; // String | 

try {
    $result = $api_instance->createFace($apiecoKey, $eyes, $nose, $mouth, $color);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AvatarApi->createFace: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::AvatarApi;

my $api_instance = WWW::SwaggerClient::AvatarApi->new();
my $apiecoKey = apiecoKey_example; # String | 
my $eyes = eyes_example; # String | 
my $nose = nose_example; # String | 
my $mouth = mouth_example; # String | 
my $color = color_example; # String | 

eval { 
    my $result = $api_instance->createFace(apiecoKey => $apiecoKey, eyes => $eyes, nose => $nose, mouth => $mouth, color => $color);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AvatarApi->createFace: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.AvatarApi()
apiecoKey = apiecoKey_example # String | 
eyes = eyes_example # String | 
nose = nose_example # String | 
mouth = mouth_example # String | 
color = color_example # String | 

try: 
    api_response = api_instance.create_face(apiecoKey, eyes, nose, mouth, color)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AvatarApi->createFace: %s\n" % e)

Parameters

Path parameters
Name Description
eyes*
String
Required
nose*
String
Required
mouth*
String
Required
color*
String
Required
Header parameters
Name Description
apieco-key*
String
Required

Responses

Status: 200 - Successful


list

We even have an API for listing all the possible parts


/avatars/list

Usage and SDK Samples

curl -X GET "https://api.apieco.ir/adorable-avatars/avatars/list"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.AvatarApi;

import java.io.File;
import java.util.*;

public class AvatarApiExample {

    public static void main(String[] args) {
        
        AvatarApi apiInstance = new AvatarApi();
        String apiecoKey = apiecoKey_example; // String | 
        try {
            inline_response_200 result = apiInstance.list(apiecoKey);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AvatarApi#list");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.AvatarApi;

public class AvatarApiExample {

    public static void main(String[] args) {
        AvatarApi apiInstance = new AvatarApi();
        String apiecoKey = apiecoKey_example; // String | 
        try {
            inline_response_200 result = apiInstance.list(apiecoKey);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AvatarApi#list");
            e.printStackTrace();
        }
    }
}
String *apiecoKey = apiecoKey_example; // 

AvatarApi *apiInstance = [[AvatarApi alloc] init];

[apiInstance listWith:apiecoKey
              completionHandler: ^(inline_response_200 output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var AdorableAvatars = require('adorable_avatars');

var api = new AdorableAvatars.AvatarApi()

var apiecoKey = apiecoKey_example; // {String} 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.list(apiecoKey, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class listExample
    {
        public void main()
        {
            
            var apiInstance = new AvatarApi();
            var apiecoKey = apiecoKey_example;  // String | 

            try
            {
                inline_response_200 result = apiInstance.list(apiecoKey);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AvatarApi.list: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\Api\AvatarApi();
$apiecoKey = apiecoKey_example; // String | 

try {
    $result = $api_instance->list($apiecoKey);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AvatarApi->list: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::AvatarApi;

my $api_instance = WWW::SwaggerClient::AvatarApi->new();
my $apiecoKey = apiecoKey_example; # String | 

eval { 
    my $result = $api_instance->list(apiecoKey => $apiecoKey);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AvatarApi->list: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.AvatarApi()
apiecoKey = apiecoKey_example # String | 

try: 
    api_response = api_instance.list(apiecoKey)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AvatarApi->list: %s\n" % e)

Parameters

Header parameters
Name Description
apieco-key*
String
Required

Responses

Status: 200 - A query response object with "hits" property