Collective2 API Quickstart Guide
Welcome to API v4! This quickstart guide will help you get started with the Collective2 API, allowing you to make your first API call and begin exploring the available endpoints.
Step 1: Sign Up and Get Your API Key
- Visit the Collective2 Sign-Up/Login Page.
- Create your account and log in.
- Navigate to your dashboard to create your API key.
Your API key is required to authenticate all API requests.
Step 2: Make Your First API Request
Let's start by making a simple request to the API:
Use the following curl
command to say hello and get a response:
curl -X POST https://api4-general.collective2.com/General/Hello \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_API_KEY" \ -d '{ "Name": "Mr. Tester" }'
Response Example
{ "Results": [ "Hello, Mr. Tester!" ], "ResponseStatus": { "ErrorCode": "200" } }
This response confirms that the request has been successful.
Step 3: Get your C2 Profile
Next, let's try a different endpoint with this curl
command:
curl -X GET https://api4.collective2.com/General/GetProfile \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_API_KEY" \
Response Example
{ "Results": [ { "Id": 110388407, "Alias": "LeaderPremium1", "FirstName": "Leader", "LastName": "Premium 1", "Email": "testuser110388407@collective2.com", "IsPhoneVerified": false, "Language": "eng", "CountryCode": "ro", "DivisionCode": "ar", "Created": "2024-09-27T17:15:21", "LastLoggedIn": "2024-10-10T17:15:19", "LastIP": "168.0.0.1", "IsEmailValidated": true, "IsAlive": true, "IsManager": false, "IsInvestor": false } ], "ResponseStatus": { "ErrorCode": "200" } }
This response confirms that you have successfully received your own profile.
Congratulations!
You've completed your first requests using the Collective2 API! Explore more advanced features in our documentation.