Ask AI
HomeInstructionsCustom Actions: Essential cURL Requests for Customer Support 

Custom Actions: Essential cURL Requests for Customer Support 

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_token

List Tickets

curl https://yoursubdomain.zendesk.com/api/v2/tickets.json \
  -v -u your_email_address/token:your_api_token

Show a Ticket

curl https://yoursubdomain.zendesk.com/api/v2/tickets/{ticket_id}.json \
  -v -u your_email_address/token:your_api_token

Update 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_token

Delete a Ticket

curl https://yoursubdomain.zendesk.com/api/v2/tickets/{ticket_id}.json \
  -X DELETE -v -u your_email_address/token:your_api_token

Create 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_token

List Users

curl https://yoursubdomain.zendesk.com/api/v2/users.json \
  -v -u your_email_address/token:your_api_token

Show a User

curl https://yoursubdomain.zendesk.com/api/v2/users/{user_id}.json \
  -v -u your_email_address/token:your_api_token

Update 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_token

Copy

Delete a User

curl https://yoursubdomain.zendesk.com/api/v2/users/{user_id}.json \
  -X DELETE -v -u your_email_address/token:your_api_token

Copy

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/tickets

Copy

List Tickets

curl -u your_api_key:x https://your_domain.freshdesk.com/api/v2/tickets

Copy

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/contacts

List Contacts

curl -u your_api_key:x https://your_domain.freshdesk.com/api/v2/contacts

View 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"
Copyright © 2024 Bot9. All rights reserved.