Post
Name | Optional / Required | Data type | Description | Default |
email | required | String | Your email address (valid email address) | |
username | required | String | Your username (Allowed characters a-z, A-Z, 0-9 and a dot, min. length 5 characters, max. length 30 characters) | |
password | required | String | Your password (min. length 6 characters) | |
gender | optional | String | Your gender (male or female) | |
firstname | optional | String | Your firstname (min. length 2 characters, max. length 100 characters) | |
lastname | optional | String | Your lastname (min. length 2 characters, max. length 100 characters) | |
birth_date | optional | Date | Your birth_date (YYYY-MM-DD) | |
address | optional | String | Your address (max. length 255 characters) | |
zip_code | optional | String | Your zip code (max. length 10 characters) | |
city | optional | String | Your city (max. length 50 characters) | |
country | optional | String | Your country (DE, GB, FR, ...) | |
description | optional | String | Your address (max. length 255 characters) | |
website | optional | String | Your website (max. length 255 characters, valid URL) | |
blog | optional | String | Your blog (max. length 255 characters, valid URL) | |
avatar | optional | String | A valid image URL | |
language | optional | String | Your language (de, en, fr, ...) | |
email username password
gender firstname lastname birth_date address zip_code city country description website blog avatar language
Add optional parametersRun request
curl
PHP
JavaScript
Java
Example:
curl -X POST -H "X-ACCESS-TOKEN: YOUR_ACCESS_TOKEN" -d "[email protected]" -d "username=api.user" -d "password=s3cr3tpassword1" -d "gender=male" -d "firstname=API" -d "lastname=User" -d "birth_date=1986-01-01" -d "address=Moosackerstr. 17" -d "zip_code=9444" -d "city=Diepoldsau" -d "country=CH" -d "description=I am the default API user." -d "website=https://www.yumpu.com" -d "blog=https://blog.yumpu.com" -d "language=de" "https://api.yumpu.com/2.0/user.json"
Example:
require_once('../yumpu.php');
$yumpu = new Yumpu();
$data = array(
'email' => '[email protected]',
'username' => 'api.user',
'password' => 's3cr3tpassword1',
'gender' => 'male',
'firstname' => 'API',
'lastname' => 'User',
'birth_date' => '1986-01-01',
'address' => 'Moosackerstr. 17',
'zip_code' => '9444',
'city' => 'Diepoldsau',
'country' => 'CH',
'description' => 'I am the default API user.',
'website' => 'https://www.yumpu.com',
'blog' => 'https://blog.yumpu.com',
'language' => 'de'
);
$newUser = $yumpu->postUser($data);
print_r($newUser);
Example:
var yumpu = require('yumpu');
yumpu.setToken('yourToken');
var parameters = {
email: '[email protected]',
username: 'api.user',
password: 's3cr3tpassword1',
gender: 'male',
firstname: 'API',
lastname: 'User',
birth_date: '1986-01-01',
address: 'Moosackerstr. 17',
zip_code: '9444',
city: 'Diepoldsau',
country: 'CH',
description: 'I am the default API user.',
website: 'https://www.yumpu.com',
blog: 'https://blog.yumpu.com',
language: 'de'
};
yumpu.postUser(parameters, function(statusCode, document){
console.log('Status: ' + statusCode);
console.log(document);
});
Example:
Yumpu y = new Yumpu("your access token");
String[] params = {"[email protected]", "username=api.user", "password=s3cr3tpassword1", "gender=male", "firstname=API", "lastname=User", "birth_date=1986-01-01", "address=Moosackerstr. 17", "zip_code=9444", "city=Diepoldsau", "country=CH", "description=I am the default API user.", "website=http://www.yumpu.com", "blog=http://blog.yumpu.com", "language=de"};
System.out.println(y.postUser(params));
Whatever language you are using, the result will be the same.
{
"user": {
"id": "102864144",
"create_date": "2013-03-08 17:13:43",
"activate_date": "2013-04-25 14:20:04",
"username": "Api.User",
"email": "[email protected]",
"gender": "male",
"name": "Api User",
"firstname": "Api",
"lastname": "User",
"birth_date": "1986-01-01",
"address": "Moosackerstr. 17",
"zip_code": "9444",
"city": "Diepoldsau",
"country": "CH",
"description": "I am the API user.",
"website": "https://www.yumpu.com",
"blog": "https://blog.yumpu.com",
"language": "de"
},
"state": "success"
}
Last modified 1yr ago