fastify-xwhatconverts
profiles.get
Fetch a single WhatConverts profile by ID.
profiles.get
Fetch a single profile by its WhatConverts ID.
Signature
fastify.xwhatconverts.profiles.get(profileId: string): Promise<object>
Params
| Name | Type | Required | Description |
|---|---|---|---|
profileId | string | Yes | The WhatConverts profile ID. |
Returns
A WhatConverts profile object.
Throws
[xWhatConverts] profiles.get: profileId is required— called withoutprofileId.[xWhatConverts] Network error: <message>— network-level failure.[xWhatConverts] API error: <status>— non-2xx response;404if profile not found.
Examples
Basic — fetch a profile
const profile = await fastify.xwhatconverts.profiles.get("98765");
console.log(profile.profile_name);
console.log(profile.profile_url);
Realistic — resolve profile before creating a lead
fastify.post("/leads", async (request, reply) => {
const { profileId, ...leadData } = request.body;
// verify profile exists before creating
await fastify.xwhatconverts.profiles.get(profileId);
const lead = await fastify.xwhatconverts.leads.create({
profileId,
leadType: "form",
...leadData,
});
return { leadId: lead.lead_id };
});
See Also
- profiles.list — list profiles
- profiles.update — update a profile
AI Context
package: "@xenterprises/fastify-xwhatconverts"
method: fastify.xwhatconverts.profiles.get(profileId)
use-when: Fetch a single WhatConverts profile by ID
params: profileId (string, required)
returns: WhatConverts profile object
