Access Using API Key

From DreamFactory
Jump to: navigation, search
DreamFactoryTutorialsAccess Using API Key
Line 1: Line 1:
DreamFactory 2.0 APIs can be consumed with just an API Key. The access is limited by the default role assigned to the  
+
DreamFactory APIs can be consumed with just an API key. Each app has a unique API key that is passed as part of each request. If no session token is provided, the access is limited by the default role assigned to the application with that API key. For this example assume your app's API key is abc123efg.
application of the API key that is being used.
+
  
=== API Endpoints ===
+
Request:
 
+
<pre>{Method} https://{url}/api/v2/{service}/{resource}?api_key={api-key}</pre>
+
 
+
-- OR --
+
 
+
<pre>{Method} https://{url}/api/v2/{service}/{resource}</pre>
+
Request header
+
<pre>
+
...
+
X-DreamFactory-Api-Key: {api_key}
+
...
+
</pre>
+
 
+
=== Example - Using URL parameter ===
+
  
 
<pre>GET https://foo.com/api/v2/system/user?api_key=abc123efg</pre>
 
<pre>GET https://foo.com/api/v2/system/user?api_key=abc123efg</pre>
 +
* HTTP Method: GET
 +
* URL: https://foo.com/api/v2
 
* Service: system
 
* Service: system
 
* Resource: user
 
* Resource: user
 
* API Key: abc123efg
 
* API Key: abc123efg
* Method: GET
 
* Request URL:
 
  
 
+
Note: API key can also be supplied using the X-DreamFactory-Api-Key request header.
=== Example - Using request header ===
+
 
+
<pre>
+
...
+
X-DreamFactory-Api-Key: abc123efg
+
...
+
</pre>
+
 
+
Request URL:
+
<pre>GET https://foo.com/api/v2/system/user</pre>
+
 
+
* Service: system
+
* Resource: user
+
* API Key: abc123efg
+
* Method: GET
+
* Request Header:
+

Revision as of 19:10, 30 June 2016

DreamFactory APIs can be consumed with just an API key. Each app has a unique API key that is passed as part of each request. If no session token is provided, the access is limited by the default role assigned to the application with that API key. For this example assume your app's API key is abc123efg.

Request:

GET https://foo.com/api/v2/system/user?api_key=abc123efg

Note: API key can also be supplied using the X-DreamFactory-Api-Key request header.