Quick Start
Quick Start
Section titled “Quick Start”This guide will help you make your first API request to Cohost.
Prerequisites
Section titled “Prerequisites”Before you begin, you’ll need:
- A Cohost account at cohost.vip
- An API key generated from your Cohost dashboard
Your First Request
Section titled “Your First Request”The Cohost API is a RESTful API that accepts JSON requests and returns JSON responses. Let’s make your first request to list coupons:
Using cURL
Section titled “Using cURL”curl https://api.cohost.vip/v1/coupons \ -H "Authorization: Bearer your_api_key_here"Using JavaScript (fetch)
Section titled “Using JavaScript (fetch)”const response = await fetch('https://api.cohost.vip/v1/coupons', { headers: { 'Authorization': 'Bearer your_api_key_here', 'Content-Type': 'application/json' }});
const data = await response.json();console.log(data);Using Python
Section titled “Using Python”import requests
response = requests.get( 'https://api.cohost.vip/v1/coupons', headers={ 'Authorization': 'Bearer your_api_key_here' })
data = response.json()print(data)Response
Section titled “Response”You’ll receive a JSON response:
{ "status": "ok", "data": [ { "id": "coupon_123", "code": "SUMMER2024", "discountType": "percentage", "discountValue": 20 } ]}Next Steps
Section titled “Next Steps”- Learn about Authentication
- Explore the Coupons API
- Browse the Events API
- Check out the full API reference