Creates a new user account and the first API key.
Not required
familyname
] Family namecallingname
] Given nametitle
] Addressing companyname
] Name of the company or general second address linesedamo
] sedamo address code for further communication by mail (if e-mail fails)email address
] E-mail address username
] 8-chars DOS-style username (exactly 8 chars!) Auto-generated if missing.password
] Min. 8-char password. Complexity will not be tested! Auto-generated if missing.language
] ISO-2 code of the preferred language for further communication. EN (English) if missing.format
{JSON | XML} the only mandatory parameter username
password
apikey
Register an user with name and full contact data:
<?php $data = array( 'format' => "JSON", 'title' => "Mr", 'callingname' => "John", 'familyname' => "Doe", 'companyname' => "ACME Ltd", 'sedamo' => "ABCDEFGH", 'email' => "john@example.com", 'username' => "john_doe", 'password' => "", // password will be generated automatically 'language' => "en" ); $url = "https://api.sedamo.info/2.0/account/create?" . http_build_query($data); $json = file_get_contents($url); $json_array = json_decode($json, true); // 2nd parameter "true": returns result as an array var_dump($json_array); // shows array
Minimalist registration: Only format given. Username, password (and API key) will be generated. E.g. for use within an app with automated registration in the background.
<?php $url = "https://api.sedamo.info/2.0/account/create?format=JSON"; $json = file_get_contents($url); $json_array = json_decode($json, true); // 2nd parameter "true": returns result as an array var_dump($json_array); // shows array
Example of a returned JSON object:
{ "status": "ok", "username": "john_doe", "password": "pass88Ax99b", "apikey": "Sample0123Sample0123Sample0123Sample0123" }
Example of a returned XML string:
<?xml version="1.0" encoding="UTF-8"?> <sedamo> <status>ok</status> <username>john_doe</username> <password>pass88Ax99b</password> <apikey>Sample0123Sample0123Sample0123Sample0123</apikey> </sedamo>
Sample error message:
{ "status": "error", "message": "data invalid" }