User Cloud Storage API \ Create User PHP SDK

Send a POST request to this endpoint to create a new user in your cloud storage database.

Resource/URI Cloud Storage Required GET POST PUT DELETE
Users /storage/users.json Create
User
User /storage/users/<user_token>.json Update
User Data
User Lookup /storage/users/user/lookup.json User
Lookup

Workflow

Request: the code to send to the API

Send a POST request with the following data to the endpoint /storage/users.json to create a new user in your cloud storage database. You can add custom data using the customData node.

POST data to include in your request

	{
  "request": {
    "user": {
      "externalid": "#externalid#",
      "login": "#login#",
      "password": "#password#",
      "identity": {
        "name": {
          "givenName": "#givenName#",
          "familyName": "#givenName#"
        },
        "customData":{
          "#custom_key1#": "#custom_value1#",
          "#custom_key2#":[
            "#custom_value21#",
            "#custom_value22#",
            "#custom_value23#"
          ],
          "#custom_key3#":{
            "#custom_key31#":"#custom_value31#",
            "#custom_key32#":"#custom_value32#",
            "#custom_key33#":"#custom_value33#"
          }
        }
      }
    }
  }
}
Key Description
#externalid# Your own user identifier for the user that you are creating. This value must be unique amongst all stored users.
This is an optional field, leave it empty to automatically generate a new identifier.
Automatically generated identifiers are sequence numbers starting at 100000001.
Example: extid1
#login# The login that the user is using to authenticate on your website or mobile application.
This is an optional field, if specified it has to be unique amongst all stored users.
Example: john.doe
#password# The password that the user is using to authenticate on your website or mobile application.
This is an optional field, leave it empty to generate a new random password.
Please note that we apply a one-way hashing algorithm prior to storing the passwords.
Example: 12345678
identity \ * All additional user information is stored in a storage identity attached to the user node.
Please refer to the following page for a complete list of possible values for the identity node.

Result: the code returned by the API

In case of a successfully request a new user with a unique user_token is added to your cloud storage database and a HTTP status code 201 is returned. If you have left the password blank the resultset also includes an automatically generated random password.

Please note that we apply a one-way hashing algorithm prior to storing the passwords. It is not possible to retrieve the password in cleartext form lateron.

The generated user_token is fully compatible with all other API endpoints and services that require a user_token, like for example our Social Link and Single Sign On services or our User API.

Example Resultset

	{
	  "response": {
	    "request": {
	      "date": "Thu, 29 Oct 2015 16:11:58  0100",
	      "resource": "/storage/users.json",
	      "status": {
	        "flag": "created",
	        "code": 201,
	        "info": "Your request has been processed successfully and resulted in a new resource being created"
	      }
	    },
	    "result": {
	      "data": {
	        "user": {
	          "user_token": "42551256-2fe6-40a4-868f-bbf2e3f3d8d8",
	          "externalid": 100000086,
	          "login": "john@.doe@example.com",
	          "password": "vsc650mILmQT",         
	          "date_creation": "Thu, 29 Oct 2015 16:11:57  0100",
	          "num_logins": 0,
	          "identity": {
	            "identity_token": "99859d8c-6422-4c47-8b5b-40928e36dbea",
	            "date_creation": "Thu, 29 Oct 2015 16:11:57  0100",
	            "date_last_update": "Thu, 29 Oct 2015 16:11:57  0100",
	            "provider": "storage",
	            "source":{
	              "name": "Cloud Storage",
	              "key": "storage"
	            },
	            "id": "/external/100000086",
	            "displayName": "John Doe",
	            "name":{
	              "formatted": "John Doe",
	              "givenName": "John",
	              "familyName": "Doe"
	            },
	            "gender": "male"
	          }          
	        }
	      }
	    }
	  }
	}

User Contributed Notes