This topic was automatically generated from Slack. You can find the original thread here.
I’ve been using a custom API for Convert Kit. Here is the code.
import axios from "axios";
export default defineComponent({
props: {
convertkit: {
type: "app",
app: "convertkit",
},
subscriberId: {
type: "string",
label: "Subscriber ID",
description: "The ID of the subscriber you want to update",
},
earningHigh: {
type: "string",
label: "Earning High",
},
earningLow: {
type: "string",
label: "Earning Low",
},
instagram: {
type: "string",
label: "Instagram",
},
},
async run({ steps, $ }) {
const url = `https://api.convertkit.com/v3/subscribers/${this.subscriberId}`;
const params = {
api_key: this.convertkit.$auth.api_key,
api_secret: this.convertkit.$auth.api_secret,
fields: {
EARNING_HIGH: this.earningHigh,
EARNING_LOW: this.earningLow,
INSTAGRAM: this.instagram,
},
};
return await axios($, {
method: "PUT",
url,
params,
});
},
});
The code works BUT the URL is having an issue. When I use the API for CONVERT KIT I am getting an error.
https://api.convertkit.com/v3/subscribers/2651614298
The error I am getting is:
{"error":"Authorization Failed","message":"API Key not present"}
I do not see a field to plug in my API Key. Does this needed to be added to my code?