> For the complete documentation index, see [llms.txt](https://docs.complycube.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.complycube.com/documentation/sdks/sdks-fr/integrations-web/hosted-solution-quick-guide/hosted-solution-quick-guide-1.md).

# Intégration guidée par les vérifications

## Vue d'ensemble

Ce guide vous accompagne dans l’intégration de la solution hébergée avec ComplyCube en utilisant l’approche guidée par les vérifications, vous donnant un contrôle direct sur chaque étape de vérification.

{% hint style="info" %}
Pour un exemple rapide à copier-coller, utilisez notre [assistant d’intégration](https://portal.complycube.com/developers).
{% endhint %}

{% hint style="warning" %}
Vous consultez le **piloté par des vérifications** guide SDK - une approche qui offre un contrôle détaillé mais qui convient mieux aux **partenaires** ou **cas d’utilisation avancés.**  Nous recommandons d’utiliser **l’intégration des flux de travail** pour la plupart des implémentations.
{% endhint %}

## Guide d'intégration

<figure><img src="/files/d608afa3b882acc4fbba788304f09643ffa5771b" alt=""><figcaption><p>Guide d’intégration du flux (solution hébergée)</p></figcaption></figure>

La solution hébergée de ComplyCube nécessite un **session de solution hébergée** à être initiée par votre backend. Voici comment cela fonctionne :

{% stepper %}
{% step %}

#### **Créer un client**

Chaque session de solution hébergée commence par un **client** (c'est-à-dire le client). Utilisez l'API pour [créer le client](/documentation/api-reference/core-resources/clients/create-a-client.md).

**Exemple de requête**

{% tabs %}
{% tab title="cURL" %}

```bash
curl -X POST https://api.complycube.com/v1/clients \\
     -H 'Authorization: <YOUR_API_KEY>' \\
     -H 'Content-Type: application/json' \\
     -d '{
          "type": "person",
          "email": "john.doe@example.com",
          "personDetails":{
               "firstName": "John",
               "lastName" :"Doe"
          }
        }'
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
const { ComplyCube } = require("@complycube/api");

const complycube = new ComplyCube({ apiKey: "<YOUR_API_KEY>" });

const client = await complycube.client.create({
  type: "person",
  email: "john.doe@example.com",
  personDetails: {
    firstName: "John",
    lastName: "Doe"
  }
});
```

{% endtab %}

{% tab title="Python" %}

```python
from complycube import ComplyCubeClient
cc_api = ComplyCubeClient(api_key='<YOUR_API_KEY>')

new_client = {
    'type':'person',
    'email':'john.doe@example.com',
    'personDetails': {
        'firstName':'John',
        'lastName':'Doe'
    }
}

client = cc_api.clients.create(**new_client)
```

{% endtab %}

{% tab title="PHP" %}

```php
use ComplyCube\ComplyCubeClient;

$ccapi = new ComplyCubeClient('<YOUR_API_KEY>');

$result = $ccapi->clients()->create([
    'type' => 'person',
    'email' => 'john@doe.com',
    'personDetails' => [
        'firstName' => 'John',
        'lastName' => 'Doe'
    ]
]);
```

{% endtab %}

{% tab title=".NET" %}

```csharp
using ComplyCube.Net;
using ComplyCube.Net.Resources.Clients;

var clientApi = new ClientApi(new ComplyCubeClient("<YOUR_API_KEY>"));
var newClient = new ClientRequest {
  type = "person",
  email = "john@doe.com",
  personDetails = new PersonDetails {
    firstName = "John",
    lastName = "Doe"
  }
}

var client = await clientApi.CreateAsync(newClient);
```

{% endtab %}
{% endtabs %}

**Exemple de réponse**

La réponse contiendra un `identifiant` (l'identifiant du client). Il est requis pour l'étape suivante.

```json
{
    "id": "5eb04fcd0f3e360008035eb1",
    "type": "person",
    "email": "john.doe@example.com",
    "personDetails": {
        "firstName": "John",
        "lastName": "Doe",
    },
    "createdAt": "2020-01-04T17:24:29.146Z",
    "updatedAt": "2020-01-04T17:24:29.146Z"
}
```

{% hint style="info" %}
Voir [Référence de l'API Clients](/documentation/api-reference/core-resources/clients.md) pour en savoir plus.
{% endhint %}
{% endstep %}

{% step %}

#### Générez une session de solution hébergée

Un **session de solution hébergée** crée une URL ComplyCube unique que vous pouvez utiliser pour rediriger vos clients afin qu’ils terminent leur vérification d’identité. Une fois terminé, vos clients seront redirigés vers l’URL de votre choix.

**Exemple de requête**

{% tabs %}
{% tab title="cURL" %}

```bash
curl -X POST https://api.complycube.com/v1/flow/sessions \
     -H 'Authorization: <YOUR_API_KEY>' \\
     -H 'Content-Type: application/json' \\
     -d '{
          "clientId":"CLIENT_ID",
          "checkTypes": ["extensive_screening_check", "identity_check", "document_check"],
          "successUrl": "https://www.yoursite.com/success",
          "cancelUrl": "https://www.yoursite.com/cancel"
        }'
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
const { ComplyCube } = require("@complycube/api");

const complycube = new ComplyCube({ apiKey: "<YOUR_API_KEY>" });

const session = await complycube.flow.createSession("CLIENT_ID", {
    checkTypes: [
      "extensive_screening_check",
      "identity_check",
      "document_check"
    ],
    successUrl: "https://www.yoursite.com/success",
    cancelUrl: "https://www.yoursite.com/cancel",
    theme: "light"
});
```

{% endtab %}

{% tab title="Python" %}

```python
from complycube import ComplyCubeClient
cc_api = ComplyCubeClient(api_key='<YOUR_API_KEY>')

flow_session = {
    'clientId': client.id,
    'checkTypes':[
        'extensive_screening_check',
        'identity_check',
        'document_check'
    ],
    'successUrl':'https://www.yoursite.com/success',
    'cancelUrl':'https://www.yoursite.com/cancel',
    'theme': 'light'
}

session = cc_api.flow.create(**flow_session)
```

{% endtab %}

{% tab title="PHP" %}

```php
use ComplyCube\ComplyCubeClient;

$ccapi = new ComplyCubeClient('<YOUR_API_KEY>');
$session = $ccapi->flow()->createSession([
    'clientId' => $clientId,
    'checkTypes' => [
        'extensive_screening_check',
        'identity_check',
        'document_check'
    ],
    'successUrl' => 'https://www.yoursite.com/success',
    'cancelUrl' => 'https://www.yoursite.com/cancel',
    'theme' => 'light'
]);
```

{% endtab %}

{% tab title=".NET" %}

```csharp
using ComplyCube.Net;
using ComplyCube.Net.Resources.FlowSessions;

var fSession = new FlowSessionApi(new ComplyCubeClient("<YOUR_API_KEY>"));

var flowSession = new FlowSessionRequest {
  clientId = aClient.id,
  checkTypes = new string[] {
    "extensive_screening_check",
    "identity_check",
    "document_check"
  },
  successUrl = "http://complycube.com",
  cancelUrl = "http://complycube.com"
};

var result = fSession.CreateAsync(flowSession).Result;
```

{% endtab %}
{% endtabs %}

**Exemple de réponse**

{% code overflow="wrap" %}

```json
{
    "redirectUrl": "https://flow.complycube.com/test_ODdkNjhiOTU0MzY4YmE5NjRmMDMyY2E5MWYwZjgxNjMzZTcyMWJmNzU2YjZmNDQ4NmFjMTU0ZGZhYTU5MmNhY2NiNjI3ZDE4YWJkYmU2M2M3ZWYzZTlmM2M3MzgxMmM3NzZhMjVlYmQyNDI0ODdkOWQ3M2JiMjkxZTYxNzdhYmExMGEzOGRhYmM2OTIwMjgyYmEzZGY3ZDY0NWZhMjcwN2RlMTFkOTcxZWNhOWI2Zjg0NjllZGNkODVjYzMzMDA5YjdlMWY5OGIwMmZjY2UzNGI2YTMxOGQxNGZmNGFhYjczNzU0YmYwMjFkMzU1M2FjMjQ4ZDQ2ZjJjZTY4YWY0MzIxNjVlMDRjOTIyYTExMTlmMWU3YTYwMDY1NGJmYWM0NTA2MDE5NTg5NTkxYzA4MzYyYTUyM2I0NDM4OGExNWIyMTIzYTBhNDc0NDA4NWM2ZTQwMmNjMGVjMTk2YW"
}
```

{% endcode %}

{% hint style="info" %}
Voir [Référence de l’API Flow Sessions](/documentation/api-reference/other-resources/tokens.md) pour en savoir plus.
{% endhint %}
{% endstep %}

{% step %}

#### Redirigez le client vers l’URL

Redirigez votre client vers le `redirectUrl` générée à l’étape précédente. Une fois que le client termine le flux sur la solution hébergée :

1. ComplyCube exécutera automatiquement les vérifications que vous avez sélectionnées lors de la création de la session (comme spécifié dans `checkTypes`).
2. Le client sera redirigé vers le `successUrl` que vous avez fournie.

Vous pouvez accéder aux résultats et à une analyse détaillée de chaque vérification via l’API ou le portail Web. Si vous avez **configuré des webhooks**, ComplyCube enverra une notification à la fin de chaque vérification.
{% endstep %}
{% endstepper %}

## Branding

Vous pouvez personnaliser les couleurs, les logos et d’autres éléments de marque via la [page des paramètres de marque](https://portal.complycube.com/settings/branding), si cette option est disponible dans votre forfait.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.complycube.com/documentation/sdks/sdks-fr/integrations-web/hosted-solution-quick-guide/hosted-solution-quick-guide-1.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
