Create User

  • Path:
/user/create
  • Type:
POST

Schemas

Request

{
    "type": "object",
    "properties": {
        "user": {
            "type": "object",
            "properties": {
                "email": {
                    "type": "string"
                },
                "password": {
                    "type": "string",
                    "minLenght": 32,
                    "maxLength": 32
                },
                "phone": {
                    "type": "string"
                }
            },
            "required": [
                "email",
                "password"
            ],
            "additionalProperties": false
        },
        "device": {
            "type": "object",
            "properties": {
                "uid": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "fiid": {
                    "type": "string"
                }
            },
            "required": [
                "uid",
                "name",
                "fiid"
            ],
            "additionalProperties": false
        }
    },
    "required": [
        "user",
        "device"
    ],
    "additionalProperties": false
}

Response

{
  "type": "object",
  "properties": {
    "status": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        }
      },
      "required": [
        "code"
      ],
      "additionalProperties": false
    },
    "token": {
      "type": "string"
    }
  },
  "required": [
    "status"
  ],
  "additionalProperties": false
}

Rules

Request

A successful request to the platform should look like the following

{
  "user": {
    "email": "dodo@dodo.com",
    "password": "encrypted_password"
  },
  "device": {
    "uid": "1986bba1-dc0e-4ab4-a9cc-1bcc4f6e8d49",
    "name": "Motorola MotoG3",
    "fiid": "fISarc9RaDU:APA91bH3kL7fCQ-8HIChn-IjHQH2iR2VrHIKOinHchvtdebZJcZz2lScXPWJ7fX7J4qy7EFdLT_U1nUdsRY162PzRfEq2XtTH9yctygC5Nlt8gtYf9djO4mJpYwqKimL_DhWmu7k3S02"
  }
}

Responses

Successful response

A user will be added to the platform if it does not exist (if its email is not already in the platform's database). In this case, the service will answer back with a status.code success

{
  "status": {
    "code": "success"
  },
  "token": "ef07188f-61e8-4d53-b9ef-e36d4596bcbf"
}

Duplicated User

If the user's email in the request message is already registered, this user won't be registered and a status.code duplicated_user will be returned

{
  "status": {
    "code": "duplicated_user"
  }
}

When a user is registered in the platform, if a device is provided in the requested, this device will be also registered and linked to the user.

Device already in use

  • If a provided device is already registered, this will be reported to the client with the status.code device_already_in_use
{
  "status": {
    "code": "device_already_in_use"
  }
}