Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Jay Mehta
/
strapi-setup-file
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Registry
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit 61d21719
authored
2022-11-03 19:16:44 +0530
by
kashif ansari
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
sperto api key and campaign ID reading from env file
1 parent
66362626
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
.env.example
src/api/lead/services/lead.js
.env.example
View file @
61d2171
...
...
@@ -21,3 +21,6 @@ AWS_ACCESS_KEY_ID=
AWS_ACCESS_SECRET=
AWS_REGION=
AWS_BUCKET=
SPERTO_API_KEY= "REALATTE-16072021-HVV14-KKJD4-GTCNJ"
CAMPAIGN_KEY="2022110305181116215817187355647526363aa7bc261a662375614"
src/api/lead/services/lead.js
View file @
61d2171
...
...
@@ -10,16 +10,18 @@ const { createCoreService } = require("@strapi/strapi").factories;
module
.
exports
=
createCoreService
(
"api::lead.lead"
,
({
strapi
:
Strapi
})
=>
({
async
sendLeadToSperto
(
data
)
{
const
headers
=
{
"Content-Type"
:
"application/json"
};
const
leadData
=
{
api_key
:
"REALATTE-16072021-HVV14-KKJD4-GTCNJ"
,
api_key
:
process
.
env
.
SPERTO_API_KEY
,
lead_category
:
"W"
,
campaign_key
:
""
,
campaign_key
:
process
.
env
.
CAMPAIGN_KEY
,
customer_name
:
data
.
fullName
,
mobile1_isd
:
data
.
mobileNumber
,
mobile1_isd
:
""
,
mobile_no1
:
data
.
mobileNumber
,
email_id1
:
data
.
email
,
};
console
.
log
(
leadData
);
const
abc
=
await
axios
.
post
(
"https://net4hgc.sperto.co.in/_api/api_auth_post_lead_json.php"
,
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment