How can i used Heysender API for create domain?

19 Views Asked by At
        const apiEndpoint = 'https://app.heysender.com/api/domains';
        const apiKey = '************';
        const apiSecret = '****************';
        const authString = `${apiKey}:${apiSecret}`;
        const base64AuthString = base64url.encode(authString);
        const authorizationHeader = `Basic ${base64AuthString}`; 
        const domain1 = {
            url: domain,
            dkim_key: privateKeyPem,
        };
        const headers = {
            'Content-Type': 'application/json',
            Authorization: authorizationHeader,
        };
        const response = await axios.post(apiEndpoint, domain1, { headers });
        const responseData = response.data;
        const domainUrl = responseData.url;
        console.log(response, "doaminUrl");

i got this in result status code 200 but in heysender documentation its status code 201.

0

There are 0 best solutions below