Creating a Rest API Client

Hello,

I’m trying to get started with the Trial Version of Confluent cloud and I am unable to connect to the API.

Listed below is the C# code:

var settings = {

“url”: “https://api.confluent.cloud/service-quota/v1/applied-quotas?scope=CAMIN CARGO CONTROL&environment=00000&network=9092&kafka_cluster=ccc_cluster_0&id=lkc-57rvon&page_size=20&page_token=5MFJZX75QVSEXPWX”,

“method”: “GET”,

“timeout”: 0,

“headers”: {

“Authorization”: “Basic NU1GSlpYNzVRVlNFWFBXWDpoY1oxVjlHQ1JiZlpXQnJxdEJZSmlxU2pZM0JLSVZZeERzUXcyM0Y0Y3o0OXl3VkQrNjdDMFNDTERpMTRjbUtD”,

“Content-Type”: “application/json”

},

“data”: JSON.stringify ({

“data”: “test connection”

}),

};

$.ajax(settings).done(function (response) {

console.log (response);

});

This is the API response:

{

“errors”: [

{

“id”: “488a2db7b810ffebe24189a4c2ee7ad9”,

“status”: “401”,

“detail”: “invalid API key: make sure you’re using a Cloud API Key and not a Cluster API Key: Confluent Cloud API Reference Documentation”,

“source”: {}

}

]

}