CORS Error in Kommo API

Hi! I have an issue while do js fetch request from website to Kommo CRM.
When I do this request I get a “CORS Error”, but in Postman this request return status 200, I think the issue in cross-origin.

This is my code:

const data = [
    {
        "name": "WEBSITE"
    }
 const response = await fetch('https://example.kommo.com/api/v4/leads', {
        method: "POST",
        headers: {
            "Access-Control-Allow-Origin": "*",
            "Authorization": "Bearer **access_token**",
            "Content-Type": "application/json",
            "Access-Control-Allow-Methods": "GET, POST, OPTIONS",
            "Access-Control-Allow-Credentials": true
        },
        credentials: 'same-origin',
        body: JSON.stringify(data),
        });
        const json = await response.json();
        console.log("Success:", JSON.stringify(json));

And screenshot of error in console


];
I will tell you more if you have any questions
Please, help me :pray:

Welcome to the Make community!

You cannot use the browser console with Make, because Make runs on the server-side.

Instead, you should use the Konmo “Make an API call” module.

Screenshot_2024-01-17_090121


Links

Here are some useful links and guides to help you get started and learn more on how to use the Make platform, apps, and app modules —

General

Help Center Basics

Articles & Videos

3 Likes