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. Attachments must be base-64 encoded before uploading.
Other options
Restful API also supports uploading - see File type details and scroll down to File Attachment. See also Uploading files for more information on all your options.
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. Set the filename attribute value 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. Don't 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 the 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 example with a truncated base64-encoded file attachment
The following request contains a truncated file in base64 encoding. Because the file is truncated, this sample won't work as shown.
Note: Your base64 file should be one continuous line without CRLF or LF characters to break the text.
Replace this example with your own encoded file.
<qdbapi>
<ticket>auth_ticket</ticket>
<apptoken>app_token</apptoken>
<udata>mydata</udata>
<field name="email">cucamonga@chuck.com</field>
<field name="assigned_number">291</field>
<field name="text">OK Corral</field>
<field name="telephone">650-345-8768.3456</field>
<field fid="22" filename="Model_T.j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0b7mVSTO2S3mRoNOkMWnXUTGPkP3QV
2EkXpcOfAMF/Y/axsmVDqxromtzb2/
r2b+qpjjAgmSTkSY0XkpJ2J+Mslar8OZHhjkvAsv3sLp4UmuYxMPVS0ujGpkjNAKcWIDpKvwy/
Bz4rz+3+8wyxBmAk1xJDJr2l2c6xy2mlwT31xAw5Rx8jxjJ/
jXJbKLRGnfbm6foz1Dy6cPV9RvV+38Xp8vtV/3bz4YQjdZ8X1j9r67/svXp6n/UP6X/
PH1P8AizAl/9kA
</field>
Your replacement file might look like this, without truncation, one continuous line without CRLF or LF characters to break the text:
<qdbapi><ticket>auth_ticket</ticket><apptoken>app_token</apptoken><udata>mydata</udata><field name="email">cucamonga@chuck.com</field><field name="assigned_number">291</field><field name="text">OK Corral</field><field name="telephone">650-345-8768.3456</field><field fid="22" filename="Model_T.jpg">8D6AAAOEJJTQQIAAAAAAAQAAAAAQAAAkAAAAJAAAAAADhCSU0EBgAAAAAABwAEAAAAAQEA4AJ0ZpbGUgd3JpdHRlbiBieSBBZG9iZSBQaG90b3Nob3CoIDQuMAD/7gAOQWRvYmUAZAAAAAAB9sAhAAGBAQEBQQGBQUGCQYFBgkLCAYGCAsMCgoLCgoMEAwMDAwMDBAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAQcHBw0MDRgQEBgUDg4OFBQODg4OFBEMDAwMDBERDAwMDAwMEQwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAz/wAARCAEsAWQDAREAAhEBAxEB/90ABAAt/8QBogAAAAcBAQEBAQAAAAAAAAAABAUDAgYBAAcICQoLAQACAgMBAQEBAQAAAAAAAAABAAIDBAUGBwgJCgsQAAIBAwMCBAIGBwMEAgYCcwECAxEEAAUhEjFBUQYTYSJxgRQykaEHFbFCI8FS0eEzFmLwJHKC8SVDNFOSorJjc8I1RCeTo7M2F1RkdMPS4ggmgwkKGBmElEVGpLRW01UoGvLj88TU5PRldYWVpbXF1eX1ZnaGlqa2xtbm9jdHV2d3h5ent8fX5/c4SFhoeIiYqLjI2Oj4KTlJWWl5iZmpucnZ6fkqOkpaanqKmqq6ytrq+hEAAgIBAgMFBQQFBgQIAwNtAQACEQMEIRIxQQVRE2EiBnGBkTKhsfAUwdHhI0IVUmJy8TMkNEOCFpJTJaJjssIHc9I14kSDF1STCAkKGBkmNkUaJ2R0VTfyo7PDKCnT4/OElKS0xNTk9GV1hZWltcXV5fVGVmZ2hpamtsbW5vZHV2d3h5ent8fX5/c4SFhoeIiYqLjI2Oj4OUlZaXmJmam5ydnp+So6SlpqeoqaqrrK2ur6/9oADAMBAAIRAxEAPwCK6Bd3Ea3CaXJDbxS2wLSSVZGVNvTmj+NTGSGIdVk+1yzFxkg0WmpdEHpck9vO2n21xBP+huF1ajklHWcEyxFmQer6a+or8x8CumWSx0b7mVSTO2S3mRoNOkMWnXUTGPkP3QV2EkXpcOfAMF/Y/axsmVDqxromtzb2/r2b+qpjjAgmSTkSY0XkpJ2J+Mslar8OZHhjkvAsv3sLp4UmuYxMPVS0ujGpkjNAKcWIDpKvwy/Bz4rz+3+8wyxBmAk1xJDJr2l2c6xy2mlwT31xAw5Rx8jxjJ/jXJbKLRGnfbm6foz1Dy6cPV9RvV+38Xp8vtV/3bz4YQjdZ8X1j9r67/svXp6n/UP6X/PH1P8AizAl/9kA</field>
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>