User

This is an object representing a user created for your company to access Product API. There is no limit on how many users a company can have, but we recommend one user per your environment.

The user object

Attributes

id integer Unique identifier for the object.

email string The user's email.

first_namestring The user's first name.

last_namestring The user's last name.

company hash The user's company. company.id integer Unique identifier for the company object. company.name string The company's name. company.products array of hashes The Redflag products, company authorized to use. company.products[].uid string Unique identifies of the offered Redflag product. company.products[].active boolean Whether the product is available for usage.

{
    "id": 1783,
    "email": "[email protected]",
    "first_name": "API",
    "last_name": "Staging",
    "company": {
        "id": 132,
        "name": "Example Company",
        "products": [
            {
                "uid": "api",
                "active": true
            }
        ]
    }
}

Sign in a user

This is the only unprotected route and required in order to obtain JWT Token before making any other requests.

Request

[POST] /api/v1/users/sign_in

Payload

user hash user.email string Your company's user email. user.password string Your company's user password.

{
	"user": {
		"email": "[email protected]",
		"password": "wkfbwekfb23"
	}
}

Example

curl -i -X POST 'https://product-api.redflagai.co/api/v1/users/sign_in' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
	"user": {
		"email": "[email protected]",
		"password": "wkfbwekfb23"
	}
}'

Response

The user object.

Last updated

Was this helpful?