Don't forget to check out our JSON RESTful APIs, they can help you utilize and extend Quickbase with ease.
Overview
Use API_UploadFile to upload base64-encoded file attachments in Quickbase.
Request parameters
Parameter | Value | Required? |
---|---|---|
field |
Specify values for file attachment fields using either the fid attribute or name attribute of the <field> element. In the opening <field> tag, insert the filename attribute in addition to the fid or name attribute. The filename attribute value should be set to the name of the file with no path specified. Insert the base64-encoded text from the encoded file between the opening and closing <field> tags. For example:
The file attachment must be a base64-encoded file. See Managing Files for more information about uploading files. Note that you must not use MIME encoding and must not include MIME headers. Many base64 encoders or base64 encoding methods are for MIME type encoding and will not work with Quickbase. You must not insert any new line characters when you base64 encode the file. If your file attachments appear to upload but don’t display in Quickbase, double check for presence of these characters. |
yes |
rid |
The id of the record that will contain the file attachment |
yes |
ticket |
A valid authentication ticket. The authentication ticket is returned via the API_Authenticate call. |
yes, one of:
|
usertoken |
The user token is an alternative means of authentication, used for API access. User tokens cannot be used to access the Quickbase UI. |
yes, one of:
|
apptoken |
A valid application token |
yes, if the application requires application tokens |
Response values
Element Name | Value |
---|---|
action |
The originating request, for example, API_UploadFile. |
errcode |
Identifies the error code, if any. (See the Error Codes appendix for a list of possible error codes.) 0 indicates that no error was encountered. |
errtext |
Text that explains the error code. "No error" indicates that no error was encountered. |
file_fields |
Contains a list of <field> elements for the uploaded file(s). Each <field> element includes a <url> element that can be used to fetch a specific uploaded file. |
Sample XML Request
See XML Request example with a truncated base64-encoded file attachment.
Sample response
<?xml version="1.0" ?>
<qdbapi>
<action>API_UploadFile</action>
<errcode>0</errcode>
<errtext>No error</errtext>
<file_fields>
<field id="13"> <!--(Uploaded
File Name)-->
<url>https://target_domain/up/bc4gzy4nx/g/rc/ep/va/qchain.log</url>
</field>
</file_fields>
</qdbapi>