Help

Re: How to get the BaseID in a script ?

347 0
cancel
Showing results for 
Search instead for 
Did you mean: 
rgrv13
4 - Data Explorer
4 - Data Explorer

Hello,

I need to send through an API call the record and base id. Please find below the script I have made, I need know to send the baseID in the payload.

Can you help me guys ? 

 

let url = "https://hook.eu2.make.com/xxxx"; // Remplacez ceci par l'URL de votre webhook

let inputConfig = input.config();


let payload = {
// Ici, construisez le corps de votre requête. Par exemple :
"recordID": inputConfig.recordID,
// Vous pouvez ajouter autant de clés/valeurs que nécessaire.
};

// Configuration de l'en-tête de la requête
let headers = {
"Content-Type": "application/json", // Type de contenu
// Ajoutez d'autres en-têtes ici si nécessaire. Par exemple :
//"Authorization": "Bearer VOTRE_TOKEN_ICI",
};

// Configuration de la requête
let options = {
method: "post", // Méthode HTTP
headers: headers,
body: JSON.stringify(payload) // Corps de la requête en format JSON
};

// Envoyer la requête
await fetch(url, options)
.then(response => response.json()) // Traitement de la réponse
.then(data => console.log(data)) // Affichage des données reçues
.catch(error => console.error("Erreur:", error)); // Gestion des erreurs

 

4 Replies 4
let payload = {
// Ici, construisez le corps de votre requête. Par exemple :
"recordID": inputConfig.recordID,
// Vous pouvez ajouter autant de clés/valeurs que nécessaire.
"baseID": base.id,
};

my god, you are the person that solved all my problems when I search on the forum and now you solved again my issue ahah

thank you so much, will try now

one more question. I need the table id too, is there an other way than doing that ?

 

let table = base.getTable("📋 Suivi des ventes");

 

let payload = {
// Ici, construisez le corps de votre requête. Par exemple :
"recordID": inputConfig.recordID,
"baseID":base.id,
"tableID":table.id
// Vous pouvez ajouter autant de clés/valeurs que nécessaire.
};

That's the way to get the table ID.