Skip to content

Commit ea23f54

Browse files
Cognito Forms: Add Upload File Support (#4102)
* Adding get and delete entry * Removing schema from default response * Fixing spelling * Adding it * Handling PR feedback to remove redirectUrl * Removing entry input parameter from GetEntry endpoint * Removing response body from delete entry operation * change to object * Update swagger file * update version * pasting error * add x-ms-summary * Update apiProperties * Update read me * Add upload file --------- Co-authored-by: Graham McDonald <graham@cognitoforms.com> Co-authored-by: Graham McDonald <gsmcdonald4@gmail.com>
1 parent 4061bb0 commit ea23f54

2 files changed

Lines changed: 109 additions & 2 deletions

File tree

certified-connectors/Cognito Forms/apiDefinition.swagger.json

Lines changed: 100 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1518,6 +1518,105 @@
15181518
"x-ms-visibility": "important"
15191519
}
15201520
},
1521+
"/api/files": {
1522+
"post": {
1523+
"tags": [
1524+
"Entries"
1525+
],
1526+
"summary": "Upload File",
1527+
"description": "Uploads a file to be used in form entries.",
1528+
"operationId": "UploadFile",
1529+
"consumes": [
1530+
"multipart/form-data"
1531+
],
1532+
"produces": [
1533+
"application/json",
1534+
"text/json"
1535+
],
1536+
"parameters": [
1537+
{
1538+
"name": "File",
1539+
"in": "formData",
1540+
"description": "The file to upload.",
1541+
"required": true,
1542+
"type": "file",
1543+
"x-ms-media-kind": "file",
1544+
"x-ms-summary": "File"
1545+
}
1546+
],
1547+
"responses": {
1548+
"200": {
1549+
"description": "OK",
1550+
"schema": {
1551+
"type": "object",
1552+
"properties": {
1553+
"Id": {
1554+
"description": "The unique id of the file.",
1555+
"type": "string",
1556+
"x-ms-summary": "File Id"
1557+
},
1558+
"Name": {
1559+
"description": "The name of the file",
1560+
"type": "string",
1561+
"x-ms-summary": "File Name"
1562+
},
1563+
"ContentType": {
1564+
"description": "The content type of the file.",
1565+
"type": "string",
1566+
"x-ms-summary": "File Content Type"
1567+
},
1568+
"Size": {
1569+
"description": "The size of the file in bytes.",
1570+
"type": "integer",
1571+
"x-ms-summary": "File Size"
1572+
}
1573+
}
1574+
}
1575+
},
1576+
"400": {
1577+
"description": "Bad Request",
1578+
"schema": {
1579+
"$ref": "#/definitions/Error"
1580+
}
1581+
},
1582+
"401": {
1583+
"description": "Unauthorized",
1584+
"schema": {
1585+
"$ref": "#/definitions/Error"
1586+
}
1587+
},
1588+
"403": {
1589+
"description": "Forbidden",
1590+
"schema": {
1591+
"$ref": "#/definitions/Error"
1592+
}
1593+
},
1594+
"404": {
1595+
"description": "Not Found",
1596+
"schema": {
1597+
"$ref": "#/definitions/Error"
1598+
}
1599+
},
1600+
"415": {
1601+
"description": "Unsupported Media Type",
1602+
"schema": {
1603+
"$ref": "#/definitions/Error"
1604+
}
1605+
},
1606+
"500": {
1607+
"description": "Internal Server Error. Unknown error occurred",
1608+
"schema": {
1609+
"$ref": "#/definitions/Error"
1610+
}
1611+
},
1612+
"default": {
1613+
"description": "Operation Failed"
1614+
}
1615+
},
1616+
"deprecated": false,
1617+
"x-ms-visibility": "important"
1618+
}
1619+
},
15211620
"/api/odata/Forms({form})/Views({viewId})/Entries": {
15221621
"get": {
15231622
"tags": [
@@ -1747,4 +1846,4 @@
17471846
"operationId": "GetForms"
17481847
}
17491848
}
1750-
}
1849+
}

certified-connectors/Cognito Forms/readme.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,14 @@ The output will be an object containing the import status, counts, and error inf
130130
- `form`: The internal form name or Id
131131
- `importId`: The ID of the import to check status for
132132

133+
#### UploadFile
134+
135+
This action will upload a file to Cognito Forms.
136+
137+
##### Parameters:
138+
- `fileContent`: The binary data of the file
139+
- `fileName`: The name of the file
140+
133141
#### GetEntryViewEntries
134142

135143
This action will get all entries for a specified view.
@@ -189,4 +197,4 @@ These properties can be found in the key vault and should only be set in the cus
189197
2. Login to PowerAutomate
190198
3. Navigate to the new connector
191199
4. Under "Security" update the `Client id` and `Client secret`
192-
5. Update the connector
200+
5. Update the connector

0 commit comments

Comments
 (0)