Contacts list
Endpoint GET /projects/:projectId/contacts
Retrieve a list of a project's contacts data.
Path Parameters
Required
projectId
- The project's id.
Query parameters:
limit
- number of contacts to retrieve (default: 10)
Example Request:
- curl
- Node.js
curl -H "Authorization: Bearer ACCESS_TOKEN" "https://api.commoninja.com/platform/api/v1/projects/894f5aed-29f5-46c5-9f26-022bfccc5292/contacts?limit=5"
const axios = require('axios');
async function getData() {
const response = await axios.get('https://api.commoninja.com/platform/api/v1/projects/894f5aed-29f5-46c5-9f26-022bfccc5292/contacts', {
headers: {
'Authorization': 'Bearer ACCESS_TOKEN'
},
params: {
limit: 5
}
});
return response.data;
}
getData();
Example Response:
{
"total": 5,
"limit": 5,
"offset": 0,
"page": 1,
"pages": 1,
"docs": [
{
"contactId": "894f5aed-29f5-46c5-9f26-022bfccc5292",
"projectId": "894f5aed-29f5-46c5-9f26-022bfccc5292",
"email": "[email protected]",
"phone": "+1234567890",
"name": "John Doe",
"thumbnail": "https://example.com/thumbnail.jpg",
"address": "123 Main St, Anytown, USA",
"company": "Acme Inc.",
"source": "Website",
"notes": ["Note 1", "Note 2"],
"created": "2023-04-25T09:44:42.842Z",
"updated": "2023-04-25T09:44:42.842Z"
}
]
}