> For the complete documentation index, see [llms.txt](https://developer.gyfti.fr/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.gyfti.fr/authentification.md).

# Authentification

All endpoints require authentification in the form of an access token which must be provided in the <mark style="color:red;">`Authorization`</mark> header as a Bearer token.&#x20;

```json
'Authorization': `Bearer YOUR_TOKEN`
```

## Generate an access token

To get a valid Bearer Token, you have to **call** the **Log in** endpoint.

This endpoint is based on your account credentials usine your account email and password.

## Login api call

<mark style="color:green;">`POST`</mark> `https://app.gyfti.fr/api/1.1/wf/login/`

This call allows you to login on the platform and get back in your success response your access Token to access all endpoints.

#### Request Body

| Name                                       | Type   | Description                                      |
| ------------------------------------------ | ------ | ------------------------------------------------ |
| email<mark style="color:red;">\*</mark>    | String | user's email login address for his gyfti account |
| password<mark style="color:red;">\*</mark> | String | user's password                                  |

{% tabs %}
{% tab title="200: OK Success with your access token" %}

```json
{
    "status": "success",
    "response": {
        "token": "[YOUR_TOKEN]",
        "user_id": "[YOUR_USER_ID]",
        "expires": 
    }
}
```

{% endtab %}
{% endtabs %}

```json
{
    "email" : "user@email.com",
    "password" : "userspassword"
}
```

## Verify credentials with token

You can use this call to verify your credentials and test you access Token.

## Verify credentials with token

<mark style="color:green;">`POST`</mark> `https://app.gyfti.fr/api/1.1/wf/is_log`

#### Headers

| Name                                            | Type   | Description             |
| ----------------------------------------------- | ------ | ----------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | 'Bearer \[YOUR\_TOKEN]' |

{% tabs %}
{% tab title="200: OK success" %}

```json
{
    "status": "success",
    "response": {
        "user": {
            "Created Date": 1632500327533,
            "Modified Date": 1654592353339,
            "user_signed_up": true,
            "authentication": {
                "email": {
                    "email": "users@email.com",
                    "email_confirmed": true
                }
            },
            "FirstName": "User First Name",
            "LastName": "User Last Name",
            "Company": "Company ID",
            "FullName": " ",
            "Picture": "Profile picture",
            "Signature": "Your signature",
            "Favorite products": [
                "Product ID",
                "Product ID"
            ],
            "Confirm-email": true,
            "news-update": true,
            "Role": "Admin",
            "Status": "Actif",
            "onboarding": true,
            "Team": "1653036584766x296414308790698000",
            "_id": "1632500327487x574792221359071300"
        },
        "state": "The user is logged in"
    }
}
```

{% endtab %}
{% endtabs %}
