Querying SQL views

From DreamFactory
Jump to: navigation, search
DreamFactoryTutorialsQuerying SQL views
(Created page with "### Tutorial GET records in a SQL view. Try these examples in the 'API Docs' tab of the DreamFactory Admin Console or from the command line with cURL. Note that querying a v...")
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
### Tutorial
 
 
 
GET records in a SQL view. Try these examples in the 'API Docs' tab of the DreamFactory Admin Console or from the command line with cURL.
 
GET records in a SQL view. Try these examples in the 'API Docs' tab of the DreamFactory Admin Console or from the command line with cURL.
  
 
Note that querying a view is the same as querying a table with DreamFactory.
 
Note that querying a view is the same as querying a table with DreamFactory.
  
### API Endpoint
+
=== API Endpoint ===
  
<pre>GET https://{url}/api/v2/{api_name}/_table/{view_name}
+
<pre>GET https://{url}/api/v2/{api_name}/_table/{view_name}</pre>
  
### API Docs Screenshot
+
=== API Docs Screenshot ===
  
 
[[File:Swagger-view.png|1000px]]
 
[[File:Swagger-view.png|1000px]]
  
### Example - GET records in a view called special_contacts
+
=== Example - GET records in a view called special_contacts ===
  
 
* View name: special_contacts
 
* View name: special_contacts
* Table_name in API call (note that this would be a view in your database): <pre>special_contacts</pre>
+
* Table_name in API call (note that this would be a view in your SQL database): <pre>special_contacts</pre>
 
* Request URL: <pre>https://foo.com/api/v2/db/_table/special_contacts</pre>
 
* Request URL: <pre>https://foo.com/api/v2/db/_table/special_contacts</pre>

Latest revision as of 20:14, 22 June 2016

GET records in a SQL view. Try these examples in the 'API Docs' tab of the DreamFactory Admin Console or from the command line with cURL.

Note that querying a view is the same as querying a table with DreamFactory.

API Endpoint

GET https://{url}/api/v2/{api_name}/_table/{view_name}

API Docs Screenshot

Swagger-view.png

Example - GET records in a view called special_contacts

  • View name: special_contacts
  • Table_name in API call (note that this would be a view in your SQL database):
    special_contacts
  • Request URL:
    https://foo.com/api/v2/db/_table/special_contacts