API_GetRecordAsHTML

Don't forget to check out our JSON RESTful APIs, they can help you utilize and extend Quickbase with ease.

 

Overview

Use API_GetRecordAsHTML to get a record within an HTML fragment that can be embedded in another Web page.

top

Request parameters

ParameterValueRequired?

rid

The record ID of the record to be edited. You can obtain the recordID of any record in a query. (See API_DoQuery.)

If you use a key field OTHER than the record id (rid), you should use the key parameter rather than rid.

yes

dfid

The dform id of the form used to generate the HTML. The resulting display matches the contents and layout  of the form you specify.

You can obtain the dfid of a form by previewing or editing the form; the dfid is part of the URL in the browser’s address bar.

no

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 Quickbase UI.

yes, one of:

  • ticket
  • username/password
  • user token

apptoken

Supply a valid application token.

yes, if the application requires application tokens

udata

A string value that you want returned. It will not be handled by Quickbase but it will be returned in the response.

no

top

Response values

The requested record, in an HTML fragment.

Element NameValue

action

Echoes the originating request, for example, API_AddField.

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.

udata

Optional. Contains any udata value supplied in the request.

top

Sample XML Request

POST https://target_domain/db/target_dbid HTTP/1.0
Content-Type: application/xml
Content-Length:
QUICKBASE-ACTION: API_GetRecordAsHTML

<qdbapi>
   <udata>mydata</udata>
   <ticket>auth_ticket</ticket>
   <apptoken>app_token</apptoken>
   <rid>2</rid>
   <dfid>10</dfid>
</qdbapi>

top

URL alternative

https://target_domain/db/target_dbid?a=API_GetRecordAsHTML&rid=18&dfid=10
&ticket=auth_ticket&apptoken=app_token

where target_domain is the domain against which you are invoking this call, for example, quickbase.com. Read about this notation.

top

Embedding a Quickbase record into a Web page

To embed a Quickbase record into a Web page on your site, add the following code to the body of your Web page:

<div id="dbPagePayload"></div>
<script lang="text/javascript">
$.post("./target_dbid?a=API_GetRecordAsHTML&rid=n", {}, function(response){
$("#dbPagePayload").html(response);
});
</script>

where target_domain is the domain against which you are invoking this call, for example, quickbase.com. Read about this notation.

top

Example Web Page Code

<html>
<head>
<!-- put styling information here -->
</head>
<body>
<h1>Example</h1>
<p> A Quickbase table embedded in a page of HTML</p>
<div id="dbPagePayload"></div>
<script lang="text/javascript">
$.post("./target_dbid?a=API_GetRecordAsHTML&rid=20", {}, function(response){
$("#dbPagePayload").html(response);
});
</script>
</body>
</html>