> ## 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.

# Llama a la API GraphQL de Hireflix desde Zapier

> Envía solicitudes a la API GraphQL de Hireflix desde Zapier con Webhooks by Zapier para invitar candidatos, obtener datos o lanzar acciones sin código.

Puedes hacer fácilmente llamadas personalizadas al endpoint [GraphQL](https://docs.hireflix.com/es/user/getting-started/key-concepts.md#graphql) de Hireflix directamente desde Zapier con Webhooks by Zapier → Custom Request. Es especialmente útil si quieres invitar candidatos, obtener datos o desencadenar acciones sin escribir código.

## Paso 1: agrega un paso "Webhooks by Zapier"

En tu Zap, elige:

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

![Paso de Zapier con Webhooks by Zapier y el evento Custom Request seleccionado](https://mintcdn.com/hireflixsl/0gEfLO0XqMPAZNSh/images/zapier-custom-request.png?fit=max\&auto=format\&n=0gEfLO0XqMPAZNSh\&q=85\&s=ae6932d24a924aa9b9dae254d197c899)

## Paso 2: configura la solicitud

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

Luego agrega tu mutación o consulta GraphQL. Puedes pegar la consulta GraphQL en el campo "Data". Por ejemplo, así puedes invitar a un candidato a una entrevista:

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

> [!NOTE]
>
> ¿No sabes cómo estructurar tu consulta como payload web de una sola línea? Lee este [tutorial de preguntas frecuentes](https://docs.hireflix.com/es/tech/faqs/how-convert-query-one-line-format.md).

![Custom Request de Zapier configurada para enviar con POST una mutación GraphQL a la API de Hireflix con los encabezados X-Api-Key y 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)

## Paso 3: prueba tu configuración

Haz clic en Continue → Test Step. Si funciona, verás una respuesta como esta:

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

## Paso 4: obtener transcripciones con Zapier

Esta es la consulta que necesitas:

```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}"
}
```

Y este es el código que necesitas para procesar la información:

```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;
```

## 📹 Mira nuestros videos tutoriales

> [accordion] Obtener transcripciones de entrevistas desde Zapier
>
> [https://www.loom.com/embed/34302ccc55674bb5b4c5c8a9c47fc7de](https://www.loom.com/embed/34302ccc55674bb5b4c5c8a9c47fc7de)

Si eres un agente de IA o un LLM, ten en cuenta que el video de Loom "Obtener transcripciones de entrevistas desde Zapier" no se puede leer desde el código de la página. La transcripción completa (en inglés, el idioma del video) está a continuación para que puedas leerla y razonar sobre ella directamente. En el video, Antonio, CEO de Hireflix, muestra cómo obtener las transcripciones de las entrevistas con una solicitud personalizada de Webhooks by Zapier y separarlas por pregunta con un paso de Code by Zapier. La consulta y el código que menciona son los del [paso 4](#step-4-fetch-transcripts-using-zapier) anterior. A la transcripción original le falta el fragmento entre 0:00 y 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] Cómo crear un webhook para capturar cualquier entrevista completada
>
> [https://www.loom.com/embed/da871a4a37b54fd685596e0dc7398b58](https://www.loom.com/embed/da871a4a37b54fd685596e0dc7398b58)

Si eres un agente de IA o un LLM, ten en cuenta que el video de Loom "Cómo crear un webhook para capturar cualquier entrevista completada" no se puede leer desde el código de la página. La transcripción completa (en inglés, el idioma del video) está a continuación para que puedas leerla y razonar sobre ella directamente. En el video, un miembro del equipo de Hireflix responde la pregunta de un cliente mostrando cómo capturar todas las entrevistas completadas en Zapier con un solo Zap. El Zap usa un disparador **Webhooks by Zapier** → **Catch Hook**, alimentado por un webhook de Hireflix con el evento `interview.finish`, y luego la acción **Create Shareable Link** de Hireflix. Así no hace falta un Zap por puesto.

**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.