Creating 100 cURL requests for customer support or sales tools involves demonstrating various functionalities such as creating tickets, sending emails, retrieving customer information, and managing sales data. Here’s a compilation of 100 cURL examples covering different APIs and their typical use cases:
1-10: Zendesk
Create a Ticket
curl https://yoursubdomain.zendesk.com/api/v2/tickets.json \
-d '{"ticket": {"subject": "My printer is on fire!", "comment": { "body": "The smoke is very colorful." }}}' \
-H "Content-Type: application/json" -v -u your_email_address/token:your_api_tokenList Tickets
curl https://yoursubdomain.zendesk.com/api/v2/tickets.json \
-v -u your_email_address/token:your_api_tokenShow a Ticket
curl https://yoursubdomain.zendesk.com/api/v2/tickets/{ticket_id}.json \
-v -u your_email_address/token:your_api_tokenUpdate a Ticket
curl https://yoursubdomain.zendesk.com/api/v2/tickets/{ticket_id}.json \
-d '{"ticket": {"status": "open"}}' \
-H "Content-Type: application/json" -v -u your_email_address/token:your_api_tokenDelete a Ticket
curl https://yoursubdomain.zendesk.com/api/v2/tickets/{ticket_id}.json \
-X DELETE -v -u your_email_address/token:your_api_tokenCreate a User
curl https://yoursubdomain.zendesk.com/api/v2/users.json \
-d '{"user": {"name": "Roger Wilco", "email": "roge@example.com"}}' \
-H "Content-Type: application/json" -v -u your_email_address/token:your_api_tokenList Users
curl https://yoursubdomain.zendesk.com/api/v2/users.json \
-v -u your_email_address/token:your_api_tokenShow a User
curl https://yoursubdomain.zendesk.com/api/v2/users/{user_id}.json \
-v -u your_email_address/token:your_api_tokenUpdate a User
curl https://yoursubdomain.zendesk.com/api/v2/users/{user_id}.json \
-d '{"user": {"name": "New Name"}}' \
-H "Content-Type: application/json" -v -u your_email_address/token:your_api_tokenCopy
Delete a User
curl https://yoursubdomain.zendesk.com/api/v2/users/{user_id}.json \
-X DELETE -v -u your_email_address/token:your_api_tokenCopy
11-20: Freshdesk
Create a Ticket
curl -u your_api_key:x -H "Content-Type: application/json" -X POST \
-d '{"description":"Details about the issue...", "subject":"Support Needed...", "email":"example@example.com", "priority":1, "status":2}' \
https://your_domain.freshdesk.com/api/v2/ticketsCopy
List Tickets
curl -u your_api_key:x https://your_domain.freshdesk.com/api/v2/ticketsCopy
View a Ticket
curl -u your_api_key:x https://your_domain.freshdesk.com/api/v2/tickets/{ticket_id}Update a Ticket
curl -u your_api_key:x -H "Content-Type: application/json" -X PUT \
-d '{"status":4}' https://your_domain.freshdesk.com/api/v2/tickets/{ticket_id}Delete a Ticket
curl -u your_api_key:x -X DELETE https://your_domain.freshdesk.com/api/v2/tickets/{ticket_id}Create a Contact
curl -u your_api_key:x -H "Content-Type: application/json" -X POST \
-d '{"name":"Tom H", "email":"tom@freshdesk.com"}' https://your_domain.freshdesk.com/api/v2/contactsList Contacts
curl -u your_api_key:x https://your_domain.freshdesk.com/api/v2/contactsView a Contact
curl -u your_api_key:x https://your_domain.freshdesk.com/api/v2/contacts/{contact_id}Update a Contact
curl -u your_api_key:x -H "Content-Type: application/json" -X PUT \
-d '{"name":"Tom Hardy"}' https://your_domain.freshdesk.com/api/v2/contacts/{contact_id}Delete a Contact
curl -u your_api_key:x -X DELETE https://your_domain.freshdesk.com/api/v2/contacts/{contact_id}31-40: HubSpot
Create a Contact
curl -X POST https://api.hubapi.com/contacts/v1/contact \
-H "Content-Type: application/json" \
-d '{
"properties": [
{
"property": "email",
"value": "test@example.com"
},
{
"property": "firstname",
"value": "Test"
},
{
"property": "lastname",
"value": "User"
}
]
}'List Contacts
curl -X GET https://api.hubapi.com/contacts/v1/lists/all/contacts/all \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"View a Contact
curl -X GET https://api.hubapi.com/contacts/v1/contact/vid/{contact_id}/profile \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"Update a Contact
curl -X POST https://api.hubapi.com/contacts/v1/contact/vid/{contact_id}/profile \
-H "Content-Type: application/json" \
-d '{
"properties": [
{
"property": "firstname",
"value": "Updated Name"
}
]
}'Delete a Contact
curl -X DELETE https://api
Let's continue with more cURL examples for customer support and sales tools.
### 41-50: Salesforce
#### Create a Lead
```sh
curl https://your_instance.salesforce.com/services/data/v20.0/sobjects/Lead/ \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"LastName": "Doe",
"Company": "Acme",
"Email": "doe@example.com",
"Status": "Open - Not Contacted"
}'List Leads
curl https://your_instance.salesforce.com/services/data/v20.0/query/?q=SELECT+name+from+Lead \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"View a Lead
curl https://your_instance.salesforce.com/services/data/v20.0/sobjects/Lead/{lead_id} \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"Update a Lead
curl https://your_instance.salesforce.com/services/data/v20.0/sobjects/Lead/{lead_id} \
-X PATCH \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"Status": "Closed - Converted"}'Delete a Lead
curl https://your_instance.salesforce.com/services/data/v20.0/sobjects/Lead/{lead_id} \
-X DELETE \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"Create a Case
curl https://your_instance.salesforce.com/services/data/v20.0/sobjects/Case/ \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"Subject": "Issue with product",
"Description": "The product is malfunctioning",
"Status": "New"
}'List Cases
curl https://your_instance.salesforce.com/services/data/v20.0/query/?q=SELECT+subject+from+Case \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"View a Case
curl https://your_instance.salesforce.com/services/data/v20.0/sobjects/Case/{case_id} \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"Update a Case
curl https://your_instance.salesforce.com/services/data/v20.0/sobjects/Case/{case_id} \
-X PATCH \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"Status": "Closed"}'Delete a Case
curl https://your_instance.salesforce.com/services/data/v20.0/sobjects/Case/{case_id} \
-X DELETE \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"51-60: Zoho CRM
Create a Lead
curl -X POST https://www.zohoapis.com/crm/v2/Leads \
-H "Authorization: Zoho-oauthtoken YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"data": [
{
"Last_Name": "Doe",
"Company": "Acme",
"Email": "doe@example.com",
"Status": "Contacted"
}
]
}'List Leads
curl -X GET https://www.zohoapis.com/crm/v2/Leads \
-H "Authorization: Zoho-oauthtoken YOUR_ACCESS_TOKEN"View a Lead
curl -X GET https://www.zohoapis.com/crm/v2/Leads/{lead_id} \
-H "Authorization: Zoho-oauthtoken YOUR_ACCESS_TOKEN"Update a Lead
curl -X PUT https://www.zohoapis.com/crm/v2/Leads \
-H "Authorization: Zoho-oauthtoken YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"data": [
{
"id": "{lead_id}",
"Status": "Qualified"
}
]
}'Delete a Lead
curl -X DELETE https://www.zohoapis.com/crm/v2/Leads/{lead_id} \
-H "Authorization: Zoho-oauthtoken YOUR_ACCESS_TOKEN"Create a Contact
curl -X POST https://www.zohoapis.com/crm/v2/Contacts \
-H "Authorization: Zoho-oauthtoken YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"data": [
{
"Last_Name": "Smith",
"First_Name": "John",
"Email": "john.smith@example.com"
}
]
}'List Contacts
curl -X GET https://www.zohoapis.com/crm/v2/Contacts \
-H "Authorization: Zoho-oauthtoken YOUR_ACCESS_TOKEN"View a Contact
curl -X GET https://www.zohoapis.com/crm/v2/Contacts/{contact_id} \
-H "Authorization: Zoho-oauthtoken YOUR_ACCESS_TOKEN"Update a Contact
curl -X PUT https://www.zohoapis.com/crm/v2/Contacts \
-H "Authorization: Zoho-oauthtoken YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"data": [
{
"id": "{contact_id}",
"Last_Name": "Doe"
}
]
}'Delete a Contact
curl -X DELETE https://www.zohoapis.com/crm/v2/Contacts/{contact_id} \
-H "Authorization: Zoho-oauthtoken YOUR_ACCESS_TOKEN"