User Cloud Storage API \ User Lookup PHP SDK

Send a POST request to this endpoint to retrieve a user based on his externalid and/or credentials.

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/users/lookup.json to retrieve a single user entry based on the externalid and/or credentials. This endpoint can be used to validate the credentials of a user that authenticates on your website or app.

POST data to include in your request

{
	"request": {
		"user": {
			"externalid": "#externalid#",
			"login": "#login#",
			"password": "#password#"
		}
	}
}
Key Description
#externalid# Your own user identifier.
#login# The user's login.
#password# The user's password.

At least one lookup field must be specified. If multiple fields are specified then only the user record that matches all fields is returned.

Result: the code returned by the API

The API returns either a HTTP status code 200, indicating a successful request, or another status code in case of an error.

Successful Result Example

  {
    "response": {
      "request": {
        "date": "Thu, 30 Oct 2015 11:11:58  0100",
        "resource": "/storage/users/user/lookup.json",
        "status": {
          "flag": "success",
          "code": 200,
          "info": "Your request has been processed successfully"
        }
      },
      "result": {
        "data": {
          "user": {
            "user_token": "2eaf5d01-8244-44b9-878d-9e83073c45e0",
            "externalid": 1000154211,
            "login": "john@.doe@example.com",      
            "date_creation": "Thu, 29 Oct 2015 16:11:57  0100",
            "date_last_update": "Thu, 29 Oct 2015 16:11:57  0100",
            "num_logins": 12,
            "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/1000154211",
              "gender": "male"
            }          
          }
        }
      }
    }
  }
  

Erroneous Result Example

{
	"response": {
		"request": {
			"date": "Wed, 04 Nov 2015 16:08:23  0100",
			"resource": "/storage/users/user/lookup.json",
			"status": {
				"flag": "error",
				"code": 404,
				"info": "No user corresponding to your lookup criteria has been found"
			}
		}
	}
}

User Contributed Notes