API_UploadFile

Overview

Use API_UploadFile to upload base64-encoded file attachments in Quick Base.

top

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:

<field fid="18" filename="photo1.jpg">…</field>

<field name="Message" filename="photo2.jpg"> …</field>

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 Quick Base.

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 Quick Base, 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:

  • ticket
  • username/password
  • user token

usertoken

The user token is an alternative means of authentication, used for API access. User tokens cannot be used to access the Quick Base UI.

yes, one of:

  • ticket
  • username/password
  • user token

apptoken

A valid application token

yes, if the application requires application tokens

top

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.

top

Sample XML Request

See XML Request example with a truncated base64-encoded file attachment.

top

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>

 

Go back    |     |  

© 1999-2017 QuickBase, Inc. All rights reserved. Legal Notices.