//native
type Klaviyo = {
apiKey: string;
};
/**
* Get Property IDs for Metric
* Get the IDs of metric properties for the given metric.*Rate limits*:Burst: `1/s`Steady: `15/m`
*/
export async function main(auth: Klaviyo, id: string, revision: string) {
const url = new URL(
`https://a.klaviyo.com/api/metrics/${id}/relationships/metric-properties`,
);
const response = await fetch(url, {
method: "GET",
headers: {
revision: revision,
"Accept": "application/vnd.api+json",
Authorization: "Klaviyo-API-Key " + auth.apiKey,
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.json();
}
Submitted by hugo697 428 days ago