Specifying fields

From DreamFactory
Jump to: navigation, search
DreamFactoryTutorialsSpecifying fields
Line 1: Line 1:
### Tutorial
+
=== Tutorial ===
  
 
Select which fields to return in a SQL or NoSQL GET request. Try these examples in the 'API Docs' tab of the DreamFactory Admin Console or from the command line with cURL.
 
Select which fields to return in a SQL or NoSQL GET request. Try these examples in the 'API Docs' tab of the DreamFactory Admin Console or from the command line with cURL.
  
### API Endpoint
+
=== API Endpoint ===
  
 
<pre>GET https://{url}/api/v2/{api_name}/_table/{table_name}?fields={field_list}</pre>
 
<pre>GET https://{url}/api/v2/{api_name}/_table/{table_name}?fields={field_list}</pre>
  
### API Docs Screenshot
+
=== API Docs Screenshot ===
  
 
[[File:Swagger-fields.png|1000px]]
 
[[File:Swagger-fields.png|1000px]]
  
### Example - GET the first names and last names from contact table
+
=== Example - GET the first names and last names from contact table ===
  
 
* Table name: contact
 
* Table name: contact
 
* Fields parameter in API call: <pre>first_name, last_name</pre>
 
* Fields parameter in API call: <pre>first_name, last_name</pre>
 
* Request URL: <pre>https://foo.com/api/v2/db/_table/contact?fields=first_name%2C%20last_name</pre>
 
* Request URL: <pre>https://foo.com/api/v2/db/_table/contact?fields=first_name%2C%20last_name</pre>

Revision as of 17:47, 3 February 2016

Tutorial

Select which fields to return in a SQL or NoSQL GET request. Try these examples in the 'API Docs' tab of the DreamFactory Admin Console or from the command line with cURL.

API Endpoint

GET https://{url}/api/v2/{api_name}/_table/{table_name}?fields={field_list}

API Docs Screenshot

Swagger-fields.png

Example - GET the first names and last names from contact table

  • Table name: contact
  • Fields parameter in API call:
    first_name, last_name
  • Request URL:
    https://foo.com/api/v2/db/_table/contact?fields=first_name%2C%20last_name