Commit 61d21719 by kashif ansari

sperto api key and campaign ID reading from env file

1 parent 66362626
...@@ -21,3 +21,6 @@ AWS_ACCESS_KEY_ID= ...@@ -21,3 +21,6 @@ AWS_ACCESS_KEY_ID=
AWS_ACCESS_SECRET= AWS_ACCESS_SECRET=
AWS_REGION= AWS_REGION=
AWS_BUCKET= AWS_BUCKET=
SPERTO_API_KEY= "REALATTE-16072021-HVV14-KKJD4-GTCNJ"
CAMPAIGN_KEY="2022110305181116215817187355647526363aa7bc261a662375614"
...@@ -10,16 +10,18 @@ const { createCoreService } = require("@strapi/strapi").factories; ...@@ -10,16 +10,18 @@ const { createCoreService } = require("@strapi/strapi").factories;
module.exports = createCoreService("api::lead.lead", ({ strapi: Strapi }) => ({ module.exports = createCoreService("api::lead.lead", ({ strapi: Strapi }) => ({
async sendLeadToSperto(data) { async sendLeadToSperto(data) {
const headers = { "Content-Type": "application/json" }; const headers = { "Content-Type": "application/json" };
const leadData = { const leadData = {
api_key: "REALATTE-16072021-HVV14-KKJD4-GTCNJ", api_key: process.env.SPERTO_API_KEY,
lead_category: "W", lead_category: "W",
campaign_key: "", campaign_key: process.env.CAMPAIGN_KEY,
customer_name: data.fullName, customer_name: data.fullName,
mobile1_isd: data.mobileNumber, mobile1_isd: "",
mobile_no1: data.mobileNumber, mobile_no1: data.mobileNumber,
email_id1: data.email, email_id1: data.email,
}; };
console.log(leadData);
const abc = await axios.post( const abc = await axios.post(
"https://net4hgc.sperto.co.in/_api/api_auth_post_lead_json.php", "https://net4hgc.sperto.co.in/_api/api_auth_post_lead_json.php",
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!