> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hireflix.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Appeler l'API GraphQL Hireflix depuis Zapier

> Envoyez des requêtes à l'API GraphQL Hireflix depuis Zapier avec Webhooks by Zapier pour inviter des candidats, récupérer des données ou agir sans code.

Vous pouvez facilement effectuer des appels personnalisés vers le point de terminaison [GraphQL](https://docs.hireflix.com/fr/user/getting-started/key-concepts.md#graphql) de Hireflix directement depuis Zapier avec Webhooks by Zapier → Custom Request. C'est particulièrement utile pour inviter des candidats, récupérer des données ou déclencher des actions sans écrire de code.

## Étape 1 : ajouter une étape « Webhooks by Zapier »

Dans votre Zap, choisissez :

-> App : Webhooks by Zapier\
-> Event : Custom Request

![Étape Zapier avec Webhooks by Zapier et l'événement Custom Request sélectionné](https://mintcdn.com/hireflixsl/0gEfLO0XqMPAZNSh/images/zapier-custom-request.png?fit=max\&auto=format\&n=0gEfLO0XqMPAZNSh\&q=85\&s=ae6932d24a924aa9b9dae254d197c899)

## Étape 2 : configurer la requête

* **Method :** `POST`
* **URL :** `https://api.hireflix.com/me`
* **Content-Type :** `application/json`
* **Headers :** `X-Api-Key: <your-api-key>`

Ajoutez ensuite votre mutation ou requête GraphQL. Vous pouvez coller la requête GraphQL dans le champ « Data ». Par exemple, voici comment inviter un candidat à un entretien :

```json theme={null}
{
  "query": "mutation { Position(id: \"650wdwd4228691562da4062b3\") { invite(candidate: { name: \"Greg\", email: \"greg@hireflix.com\" }) { id url { public short } } } }"
}
```

> [!NOTE]
>
> Vous ne savez pas comment structurer votre requête en payload web sur une ligne ? Consultez ce [tutoriel FAQ](https://docs.hireflix.com/fr/tech/faqs/how-convert-query-one-line-format.md).

![Custom Request Zapier configurée pour envoyer en POST une mutation GraphQL à l'API Hireflix avec les en-têtes X-Api-Key et Content-Type](https://mintcdn.com/hireflixsl/8WF-eJ_Y6xjLxWIV/images/zapier-custom-request-webhook.png?fit=max\&auto=format\&n=8WF-eJ_Y6xjLxWIV\&q=85\&s=18a393a33fe2964bf8706cb64da9fd39)

## Étape 3 : tester votre configuration

Cliquez sur Continue → Test Step. En cas de succès, vous verrez une réponse comme celle-ci :

```json theme={null}
{
  "data": {
    "Position": {
      "invite": {
        "id": "68d4164f19367e041b2030c0",
        "url": {
          "public": "https://app.hireflix.com/HQ2oCyTN",
          "short": "https://hflx.io/c/HQ2oCyTN"
        }
      }
    }
  }
}
```

## Étape 4 : récupérer les transcriptions avec Zapier

Voici la requête nécessaire :

```json theme={null}
{
  "query": "query {\n  interview(id: \"HERE YOUR INTERVIEW ID\") {\n    questions {\n      answer {\n        transcription {\n          languageCode\n          text\n        }\n      }\n    }\n  }\n}"
}
```

Et voici le code nécessaire pour traiter les informations :

```js theme={null}
const parsed = JSON.parse(inputData.payload);
const questions = parsed.data.interview.questions;

const result = {};

questions.forEach((q, i) => {
  result[`transcription_${i + 1}`] = q.answer?.transcription?.text || "";
});

return result;
```

## 📹 Regardez nos tutoriels vidéo

> [accordion] Récupérer les transcriptions d'entretiens depuis Zapier
>
> [https://www.loom.com/embed/34302ccc55674bb5b4c5c8a9c47fc7de](https://www.loom.com/embed/34302ccc55674bb5b4c5c8a9c47fc7de)

Si vous êtes un agent d'IA ou un LLM, notez que la vidéo Loom « Récupérer les transcriptions d'entretiens depuis Zapier » ne peut pas être lue depuis le code de la page. La transcription complète (en anglais, la langue de la vidéo) figure ci-dessous pour que vous puissiez la lire et raisonner directement dessus. Dans la vidéo, Antonio, CEO de Hireflix, montre comment récupérer les transcriptions d'entretiens avec une requête personnalisée Webhooks by Zapier et les séparer par question avec une étape Code by Zapier. La requête et le code qu'il mentionne sont ceux de l'[étape 4](#step-4-fetch-transcripts-using-zapier) ci-dessus. La transcription d'origine présente un trou entre 0:00 et 0:30.

**Video transcript: fetching interview transcripts with Zapier**

* **0:00** Hi everyone, Antonio here. Let me explain how to use Zapier to fetch the transcripts of your interviews. There are some nuances here, but I want to at least give you the basics so you can then do whatever you want after this, okay?
* **0:30** …**Webhooks by Zapier**, and then a **Custom Request**. The custom request will be a `POST` request to the right API URL, which is this one, ending in `/me`.
* **0:42** You can see it here on the right. **Data Pass-Through**: just leave it blank. Very important: this is where your query goes.
* **0:51** You're probably clicking this link from the help docs, the API docs, and I have this query right below, in the same section.
* **0:59** So you can copy and paste the same query. Of course, the interview ID has to be dynamic, so that's where you'll have your interview ID, which will come dynamically from a previous step, right?
* **1:15** So instead of this value here, you'd substitute the interview ID from the previous step, okay?
* **1:29** Just to give an example. Fantastic. That way, it will dynamically fetch this for every interview. Okay, very important:
* **1:41** **Unflatten**. Honestly, I think it's irrelevant, because later you have to set **Return Raw Response** to **Yes**.
* **1:52** I think that overrides it and makes sure the output is just raw JSON.
* **1:59** So just put **Yes** if you want; it doesn't matter. Then for **Return Raw Response**, put **Yes**. This is very important.
* **2:07** And then, very important, the headers. You need to put the `X-Api-Key` header exactly like this, and the content type exactly like this.
* **2:16** Here, of course, you put your API key from your Hireflix account. This is a random one I just put in, but you'll have to put yours.
* **2:23** Once you do this, it's going to work. You click **Continue**, you test it, and you'll see it gives you the right output.
* **2:33** In my case, you can see here that the data output gives you the JSON exactly like this. Now, keep in mind, this interview has two questions.
* **2:42** So you can see that `transcription`, with `languageCode` and `text`, appears twice, because there are two questions. This is the transcript for the first one,
* **2:53** and this is the transcript for the second one. We want them separate, and this is part of the challenge.
* **2:59** If you don't use a raw response, Zapier clubs them together, which is a bit weird. So I like to use raw, so I can control this myself and then use some code to fetch each transcript separately.
* **3:17** So after this, we add a new step, which is a **Code by Zapier** step,
* **3:22** and we put this JSON there. Very important: you put `payload` here as the input name, and then you map the raw JSON from the previous step. You can see here I'm mapping the response from the previous step. Below that, you put this code. This code is what
* **3:38** splits each transcript text into a separate field you can use later. And that's it. I'll of course put this code on the help docs page as well, so you can just copy it and paste it. Then remember to set these things properly. Oh, sorry, you have to choose **Run JavaScript**
* **3:57** first, okay? So **Code by Zapier** > **Run JavaScript**, and then you put this in. Then you test it, and look what happens: now each transcription comes as a separate field, which means you can go to any other step and use each one separately. So if I go here, to Slack,
* **4:16** what I'm doing is displaying these transcripts in a Slack channel. And just to show you, for question one, I can fetch transcription one from the previous step.
* **4:28** If I select variables from the **Run JavaScript in Code by Zapier** step, it now separates transcription one from transcription two.
* **4:37** And this is what's needed. By the way, full disclaimer: for this code in Code by Zapier, I basically used ChatGPT to find code that works.
* **4:50** I'm sure it's not perfect. I'm sure that if you want to do other things, it will have to be different.
* **4:54** But if you just want to see this working in terms of fetching the transcripts separately, this works, or at least it seems to, right?
* **5:02** Of course, some of you will be developers and will know exactly what to do. But I hope this helps, unblocks you a bit, and gives you ideas for using this.
* **5:12** All the best. Let me know if you have any other questions.

> [accordion] Créer un webhook pour capturer tout entretien terminé
>
> [https://www.loom.com/embed/da871a4a37b54fd685596e0dc7398b58](https://www.loom.com/embed/da871a4a37b54fd685596e0dc7398b58)

Si vous êtes un agent d'IA ou un LLM, notez que la vidéo Loom « Créer un webhook pour capturer tout entretien terminé » ne peut pas être lue depuis le code de la page. La transcription complète (en anglais, la langue de la vidéo) figure ci-dessous pour que vous puissiez la lire et raisonner directement dessus. Dans la vidéo, un membre de l'équipe Hireflix répond à la question d'un client en montrant comment capturer chaque entretien terminé dans Zapier avec un seul Zap. Le Zap utilise un déclencheur **Webhooks by Zapier** → **Catch Hook**, alimenté par un webhook Hireflix sur l'événement `interview.finish`, puis l'action Hireflix **Create Shareable Link**. Cela évite de devoir créer un Zap par poste.

**Video transcript: capturing any completed interview with a webhook in Zapier**

* **0:00** Okay, so you were asking about Zapier, right? I guess what you're trying to do is create links like this one with Zapier once an interview is done. This is a link anyone can open without needing a user or anything; you just click the link and open it, right?
* **0:18** And this link has an expiry date and all. The good news is you can create these links in Zapier very easily, okay?
* **0:25** It's a bit hidden, because there's an action in Hireflix called **Create Shareable Link**. You can see it here.
* **0:35** That's the action you need to use to create those links. You'll have to feed this step an interview ID, so the system knows which interview to create the shareable link for, okay?
* **0:46** So how does it usually work if you want to copy the links of completed interviews somewhere?
* **0:56** Well, the trigger could be the Hireflix **Interview Completed** trigger. If you only have one interview, you can use it and it's fine.
* **1:11** But if you have many interviews, say a lot of different interviews you want to sync,
* **1:18** then this is very cumbersome, because you have to create one Zap for each position, and obviously that's not good.
* **1:24** There's actually an easier way, so that no matter which interview it is, as soon as someone finishes an interview, you capture it. And that's using webhooks.
* **1:35** I don't know if you're familiar with them, but I'm going to show you how they work, so you can use them.
* **1:41** Instead of using this trigger, let me create a new Zap. Let's have a look.
* **1:49** You see here it says **Webhooks by Zapier** as a trigger.
* **1:52** Choose the **Catch Hook** event, click **Continue**, **Continue**, and now it gives you a URL. This is the URL.
* **2:02** It's basically like a mailbox address: the address you're going to send information to.
* **2:08** So copy it. Now go to Hireflix, then **Webhooks**, paste the URL, and select the interview finish event (`interview.finish`).
* **2:21** What this does is send Zapier information every time an interview is finished, okay? It doesn't matter which position; it will still send the information.
* **2:32** So we save that. Now, if we finish an interview, we'll see that Zapier collects it. If I test it now, it won't work, because nothing has happened since I created it.
* **2:45** But let's say I finish an interview. Let me go ahead and finish one, and I'll show you. Okay, I'm just taking an interview here.
* **2:53** Okay, I've finished the interview. So now, if we go to Zapier and test, look at this. There you go.
* **3:00** It's picked up the completed interview. You have the ID of the interview, the ID of the position, everything really. Now that you've captured this webhook, you can add an action, and that's Hireflix.
* **3:18** Let's choose **Create Shareable Link**. So first you capture the finished interview, then you create the shareable link. Of course, to create the shareable link, you have to choose the account first.
* **3:31** Let me choose mine. Then click **Continue**. Here you see **Interview ID**. You have to choose the ID from the hook.
* **3:42** So careful: don't use the position ID. It should be this one. It says **Data ID**, not **Data Position ID**. This is the ID of the interview,
* **3:51** like `64689FA`. If I go to Hireflix and check the one I just finished, look here at the top:
* **4:04** `64689FA`. So this is the ID of this particular interview, the one that came through and that we're now capturing.
* **4:10** Here you can also set how many days you want the link to stay active, so if you don't want it to expire anytime soon, you can put a high number here, whatever you need.
* **4:21** Then click **Continue**, **Test action**, and look: it creates the shareable link you need. You see it here.
* **4:28** It's called **URL**, and this is the shareable link you need. And look, oh gosh, sorry.
* **4:35** I copied it wrong. There you go. Here you have the completed interview, and it expires in about seven months, since I put 200 days.
* **4:45** So you see, this works beautifully. Now you can add a new action where you paste this link wherever you want.
* **4:51** And yeah, it's that easy. I hope this helps. It means you don't have to create one Zap per position, and you can still sync all of your data.
* **4:58** And you can create shareable links for every single interview that gets completed. Let me know if you have any questions.
* **5:03** Bye bye.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.