forked from pnp/copilot-pro-dev-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.yaml
More file actions
137 lines (137 loc) · 6.55 KB
/
Copy pathopenapi.yaml
File metadata and controls
137 lines (137 loc) · 6.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
openapi: 3.0.0
info:
title: Salesforce API
description: API for querying Salesforce data
version: 1.0.0
servers:
- url: ${{ENDPOINT_URL}}
security:
- OAuth2AuthCode: []
paths:
/services/data/v62.0/query:
get:
summary: Retrieve sales data.
description: Execute a SOQL query to retrieve sales data (Leads, Accounts, Opportunities, Contacts, Tasks, Cases and more) from Salesforce. The query is provided via the `soql` query parameter.
parameters:
- in: query
name: q
required: true
schema:
type: string
description: >
The Salesforce Object Query Language (SOQL) query to execute. Your preference is to get all standard fields with limit of 50 unless user has explicitly provided filters. Always use Date literals for filtering by Where clauses and Group by.\r\n \r\n **Opportunity Examples:**\r\n - *Select all standard fields:* \r\n `SELECT FIELDS(STANDARD) FROM Opportunity LIMIT 10`\r\n - *Select specific fields with a filter:* \r\n `SELECT Id, Name, StageName FROM Opportunity WHERE IsClosed = FALSE AND CloseDate = THIS_MONTH\r\n \r\n **Case Examples:**\r\n - *Select all standard fields:* \r\n `SELECT FIELDS(STANDARD) FROM Case LIMIT 10`\r\n - *Select specific fields with a filter:* \r\n `SELECT Id, Subject, Status FROM Case WHERE Subject LIKE '%Error%'`\r\n \r\n **Task Examples:**\r\n - *Select all standard fields:* \r\n `SELECT FIELDS(STANDARD) FROM Task LIMIT 10`\r\n - *Select specific fields with a filter:* \r\n `SELECT Id, Subject, ActivityDate FROM Task WHERE Subject LIKE '%Call%'`\r\n \r\n **Account Examples:**\r\n - *Select all standard fields:* \r\n `SELECT FIELDS(STANDARD) FROM Account LIMIT 10`\r\n - *Select specific fields with a filter:* \r\n `SELECT Id, Name, Industry FROM Account WHERE Name LIKE '%Acme%'`\r\n \r\n **Lead Examples:**\r\n - *Select all standard fields:* \r\n `SELECT FIELDS(STANDARD) FROM Lead LIMIT 10`\r\n - *Select specific fields with a filter:* \r\n `SELECT Id, FirstName, LastName, Company FROM Lead WHERE LastName LIKE '%Smith%'`\r\n \r\n **Contact Examples:**\r\n - *Select all standard fields:* \r\n `SELECT FIELDS(STANDARD) FROM Contact LIMIT 10`\r\n - *Select specific fields with a filter:* \r\n `SELECT Id, FirstName, LastName, Email FROM Contact WHERE Email LIKE '%@example.com%'`
responses:
'200':
description: Successful response
content:
application/json:
schema:
type: object
properties:
totalSize:
type: integer
done:
type: boolean
records:
type: array
items:
type: object
'400':
description: Bad request
'401':
description: Authentication failed
'403':
description: Forbidden
operationId: getSalesData
/services/data/v62.0/sobjects/Task/:
post:
summary: Create a Task Record to Log a Call
description: >
Creates a new Task record in Salesforce that logs a call.
operationId: createCallTask
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
Subject:
type: string
description: >
The subject of the task.
default: Call
ActivityDate:
type: string
format: date
description: The date when the call occurred. Use default value as the current date.
example: 2025-03-11
Status:
type: string
description: >
The status of the task. Salesforce may require specific values (e.g., "Completed").
default: Completed
Priority:
type: string
description: The priority of the task.
default: Normal
CallDurationInSeconds:
type: integer
description: Duration of the call in seconds.
default: 1800
CallDisposition:
type: string
description: The outcome of the call (e.g., "Connected")
default: Connected
Description:
type: string
description: Summary of the call.
example: Discussed product updates and next steps.
WhoId:
type: string
description: >
ID of the associated Contact or Lead. This is optional.
example: 003xx000004TmiQAAS
WhatId:
type: string
description: >
ID of the Account.
example: 006xx000004TmiRAAS
required:
- Subject
- ActivityDate
- Description
- Status
- WhatId
responses:
'201':
description: Task created successfully.
content:
application/json:
schema:
type: object
properties:
id:
type: string
description: The ID of the created Task.
success:
type: boolean
example: true
errors:
type: array
items:
type: string
'400':
description: Bad Request - The input data is invalid.
'500':
description: Internal Server Error - An unexpected error occurred.
components:
securitySchemes:
OAuth2AuthCode:
type: oauth2
flows:
authorizationCode:
authorizationUrl: https://login.salesforce.com/services/oauth2/authorize
tokenUrl: https://login.salesforce.com/services/oauth2/token
refreshUrl: https://login.salesforce.com/services/oauth2/token
scopes: {}