You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by ti...@apache.org on 2013/12/20 10:15:13 UTC

svn commit: r1552550 [3/13] - in /incubator/usergrid/site: content/community/ content/docs/ layouts/ lib/helpers/ publish/community/ publish/docs/access-token/ publish/docs/activity/ publish/docs/admin-portal/ publish/docs/admin-user/ publish/docs/app-...

Modified: incubator/usergrid/site/content/docs/organizations-admins.md
URL: http://svn.apache.org/viewvc/incubator/usergrid/site/content/docs/organizations-admins.md?rev=1552550&r1=1552549&r2=1552550&view=diff
==============================================================================
--- incubator/usergrid/site/content/docs/organizations-admins.md (original)
+++ incubator/usergrid/site/content/docs/organizations-admins.md Fri Dec 20 09:15:11 2013
@@ -14,16 +14,6 @@ organization can be representative of a 
 allows multiple applications  to be shared within the organization with
 other administrators.
 
-Using the App services API, you can create an organization through a
-form post and get an organization by UUID or name. In addition, you can
-activate or reactivate an organization, generate and retrieve an
-organization's client credentials, and get an organization's activity
-feed. You can also create an organization application through a form
-post, generate and retrieve credentials for the application, and delete
-the application. You can also get the applications in an organization.
-Additionally, you can add an admin user to an organization, get the
-admin users in an organization, and remove an admin user from an
-organization.
 
 Property                                Type      Description
 --------------------------------------- --------- ---------------------------------------------------------------------
@@ -38,1777 +28,12 @@ email                                   
 password                                string    The password of the administrator. (create-only)
 
 
-
-### Activating an organization
-
-Use the GET method to activate an organization from a link provided in
-an email notification.
-
-#### Request URL
-
-GET
-/organizations|orgs/{org\_name}|{uuid}/activate?token={token}&confirm={confirm\_email}
-
-Parameters
-
-  Parameter                   Description
-  --------------------------- -------------------------------------------------
-  string org\_name|arg uuid   Organization name or organization UUID.
-  string token                Activation token (supplied via email).
-  boolean confirm\_email      Send confirmation email (false is the default).
-
- 
-
-#### Example - Request
-
--   [cURL](#curl_activate_org)
--   [JavaScript (HTML5)](#javascript_activate_org)
--   [Ruby](#ruby_activate_org)
--   [Node.js](#nodejs_activate_org)
-
-<!-- -->
-
-    curl -X GET "https://api.usergrid.com/management/orgs/testorg/activate?token=33dd0563-cd0c-11e1-bcf7-12313d1c4491"
-
-It is recommended that you use the [Admin
-Portal](http://apigee.com/usergrid) for administrative activities
-instead of using JavaScript to do them programmatically in your app.
-
-**Note:**You can see the response below in the Admin Portal by using the
-[JavaScript
-Console](/docs/usergrid/content/displaying-app-services-api-calls-curl-commands).
-
-The example assumes use of the [Ruby
-SDK](https://github.com/scottganyo/usergrid_iron).
-
-    mgmt = Usergrid::Management.new 'https://api.usergrid.com/'
-    mgmt['orgs/testorg/activate'].get params: { token: '33dd0563-cd0c-11e1-bcf7-12313d1c4491' }
-
-The example assumes use of the [Node.js
-module](https://github.com/apigee/usergrid-node-module).
-
-    var options = {
-        method:'GET',
-        endpoint:'management/orgs/testorg/activate',
-        qs:{token:'33dd0563-cd0c-11e1-bcf7-12313d1c4491'}
-    };
-    client.request(options, function (err, data) {
-        if (err) {
-            //error — GET failed
-        } else {
-            //success — data will contain raw results from API call       
-        }
-    });
-
-#### Example - Response
-
-    {
-      "action": "activate organization",
-      "timestamp": 1337928462810,              
-      "duration": 3342
-    }
-
-### Reactivating an organization
-
-Use the GET method to reactivate an organization.
-
-#### Request URI
-
-GET /organizations|orgs/{org\_name}|{uuid}/reactivate
-
-Parameters
-
-  Parameter                   Description
-  --------------------------- -----------------------------------------
-  string org\_name|arg uuid   Organization name or organization UUID.
-
- 
-
-#### Example - Request
-
--   [cURL](#curl_reactivate_org)
--   [JavaScript (HTML5)](#javascript_reactivate_org)
--   [Ruby](#ruby_reactivate_org)
--   [Node.js](#nodejs_reactivate_org)
-
-<!-- -->
-
-    curl -X GET "https://api.usergrid.com/management/orgs/testorg/reactivate"
-
-It is recommended that you use the [Admin
-Portal](http://apigee.com/usergrid) for administrative activities
-instead of using JavaScript to do them programmatically in your app.
-
-**Note:**You can see the response below in the Admin Portal by using the
-[JavaScript
-Console](/docs/usergrid/content/displaying-app-services-api-calls-curl-commands).
-
- 
-
-The example assumes use of the [Ruby
-SDK](https://github.com/scottganyo/usergrid_iron).
-
-    mgmt = Usergrid::Management.new 'https://api.usergrid.com/'
-    mgmt['orgs/testorg/reactivate']
-
-The example assumes use of the [Node.js
-module](https://github.com/apigee/usergrid-node-module).
-
-    var options = {
-        method:'GET',
-        endpoint:'management/orgs/testorg/reactivate'
-    };
-    client.request(options, function (err, data) {
-        if (err) {
-            //error — GET failed
-        } else {
-            //success — data will contain raw results from API call       
-        }
-    });
-
-#### Example - Response
-
-    {
-      "action": "reactivate organization",
-      "timestamp": 1349385280891,
-      "duration": 3612
-    }
-
-### Generating organization client credentials
-
-Use the POST method to generate new credentials for an organization
-client.
-
-#### Request URI
-
-POST /organizations|orgs/{org\_name}|{uuid}/credentials
-
-Parameters
-
-  Parameter                   Description
-  --------------------------- -----------------------------------------
-  string org\_name|arg uuid   Organization name or organization UUID.
-
-**Note:** You also need to provide a valid access token with the API
-call. See [Authenticating users and application
-clients](/authenticating-users-and-application-clients) for details.
-
- 
-
-#### Example - Request
-
--   [cURL](#curl_gen_org_credentials)
--   [JavaScript](#javascript_gen_org_credentials)
--   [Ruby](#ruby_gen_org_credentials)
--   [Node.js](#nodejs_gen_org_credentials)
-
-<!-- -->
-
-    curl -X POST "https://api.usergrid.com/management/orgs/credentials"
-
-It is recommended that you use the [Admin
-Portal](http://apigee.com/usergrid) for administrative activities
-instead of using JavaScript to do them programmatically in your app.
-
-**Note:**You can see the response below in the Admin Portal by using the
-[JavaScript
-Console](/docs/usergrid/content/displaying-app-services-api-calls-curl-commands).
-
-The example assumes use of the [Ruby
-SDK](https://github.com/scottganyo/usergrid_iron).
-
-    mgmt = Usergrid::Management.new 'https://api.usergrid.com/'
-    mgmt['orgs/credentials'].create
-
-The example assumes use of the [Node.js
-module](https://github.com/apigee/usergrid-node-module).
-
-    var options = {
-        method:'POST',
-        endpoint:'management/orgs/credentials'
-    };
-    client.request(options, function (err, data) {
-        if (err) {
-            //error — POST failed
-        } else {
-            //success — data will contain raw results from API call       
-        }
-    });
-
-#### Example - Response
-
-    {
-      "action": "generate organization client credentials",
-      "timestamp": 1349385795647,
-      "duration": 7,
-      "credentials":  {
-        "client_id": "c2V7N61DY90MCdG78xIxPRxFdQ",                  
-        "client_secret": "c2V7WEdXIutZWEkWdySLCt_lYDFVMMN"                      
-      }
-    }
-
-### Retrieving organization client credentials
-
-Use the GET method to retrieve the credentials for an organization
-client.
-
-#### Request URL
-
-GET /organizations|orgs/{org\_name}|{uuid}/credentials
-
-Parameters
-
-  Parameter                   Description
-  --------------------------- -----------------------------------------
-  string org\_name|arg uuid   Organization name or organization UUID.
-
-**Note:** You also need to provide a valid access token with the API
-call. See [Authenticating users and application
-clients](/authenticating-users-and-application-clients) for details.
-
- 
-
-#### Example - Request
-
--   [cURL](#curl_get_org_credentials)
--   [JavaScript (HTML5)](#javascript_get_org_credentials)
--   [Ruby](#ruby_get_org_credentials)
--   [Node.js](#nodejs_get_org_credentials)
-
-<!-- -->
-
-    curl -X GET "https://api.usergrid.com/management/orgs/testorg/credentials"
-
-It is recommended that you use the [Admin
-Portal](http://apigee.com/usergrid) for administrative activities
-instead of using JavaScript to do them programmatically in your app.
-
-**Note:**You can see the response below in the Admin Portal by using the
-[JavaScript
-Console](/docs/usergrid/content/displaying-app-services-api-calls-curl-commands).
-
-The example assumes use of the [Ruby
-SDK](https://github.com/scottganyo/usergrid_iron).
-
-    mgmt = Usergrid::Management.new 'https://api.usergrid.com/'
-    mgmt['orgs/testorg/credentials']
-
-The example assumes use of the [Node.js
-module](https://github.com/apigee/usergrid-node-module).
-
-    var options = {
-        method:'GET',
-        endpoint:'management/orgs/testorg/credentials'
-    };
-    client.request(options, function (err, data) {
-        if (err) {
-            //error — GET failed
-        } else {
-            //success — data will contain raw results from API call       
-        }
-    });
-
-#### Example - Response
-
-    {
-      "action": "get organization client credentials",
-      "timestamp": 1349386672984,
-      "duration": 690,
-      "credentials":  {
-        "client_id": "c2V7N61DY90MCdG78xIxPRxFdQ",                  
-        "client_secret": "c2V7WEdXIutZWEkWdySLCt_lYDFVMMN"                      
-      }
-    }
-
-### Getting an organization's activity feed
-
-Use the GET method to get an organization's activity feed.
-
-#### Request URI
-
-GET /organizations|orgs/{org\_name}|{uuid}/feed
-
-Parameters
-
-  Parameter                   Description
-  --------------------------- -----------------------------------------
-  string org\_name|arg uuid   Organization name or organization UUID.
-
-**Note:** You also need to provide a valid access token with the API
-call. See [Authenticating users and application
-clients](/authenticating-users-and-application-clients) for details.
-
- 
-
-#### Example - Request
-
--   [cURL](#curl_get_org_feed)
--   [JavaScript (HTML5)](#javascript_get_org_feed)
--   [Ruby](#ruby_get_org_feed)
--   [Node.js](#nodejs_get_org_feed)
-
-<!-- -->
-
-    curl -X GET "https://api.usergrid.com/management/orgs/testorg/feed"
-
-It is recommended that you use the [Admin
-Portal](http://apigee.com/usergrid) for administrative activities
-instead of using JavaScript to do them programmatically in your app.
-
-**Note:**You can see the response below in the Admin Portal by using the
-[JavaScript
-Console](/docs/usergrid/content/displaying-app-services-api-calls-curl-commands).
-
-The example assumes use of the [Ruby
-SDK](https://github.com/scottganyo/usergrid_iron).
-
-    mgmt = Usergrid::Management.new 'https://api.usergrid.com/'
-    activities = mgmt['orgs/testorg/feed'].collection
-
-The example assumes use of the [Node.js
-module](https://github.com/apigee/usergrid-node-module).
-
-    var options = {
-        method:'GET',
-        endpoint:'management/orgs/testorg/feed'
-    };
-    client.request(options, function (err, data) {
-        if (err) {
-            //error — GET failed
-        } else {
-            //success — data will contain raw results from API call       
-        }
-    });
-
-#### Example - Response
-
-    {
-     {
-      "action": "get organization feed",
-      "status": "ok",
-      "entities":  [
-         {
-          "uuid": "cf4d981c-fe90-11e1-95c8-12313b122c56",
-          "type": "activity",
-          "created": 1347643370454,
-          "modified": 1347643370454,
-          "actor":  {
-            "displayName": "tester123",
-            "objectType": "person",
-            "uuid": "327b527f-cd0c-11e1-bcf7-12313d1c4491",
-            "entityType": "user"
-          },
-          "category": "admin",
-          "metadata":  {
-            "cursor": "gGkAAQMAgGkABgE5xc3r1gCAdQAQz02YHP6QEeGVyBIxOxIsVgCAdQAQz3SoH_6QEeGVyBIxOxIsVgA",
-            "path": "/groups/33dd0563-cd0c-11e1-bcf7-12313d1c4491/feed/cf4d981c-fe90-11e1-95c8-12313b122c56"
-          },
-    "object":  {
-            "displayName": "testapp2",
-            "objectType": "Application",
-            "uuid": "cede5b7e-fe90-11e1-95c8-12313b122c56",
-            "entityType": "application_info"
-          },
-          "published": 1347643370454,
-          "title": "<a mailto="mailto:tester123@hotmail.com">tester123 (tester123@hotmail.com)</a> created a new application named testapp2",
-          "verb": "create"
-        },...
-    ,
-      "timestamp": 1349387253811,
-
-### Creating an organization application
-
-Use the POST method to create an application for an organization through
-a form post.
-
-#### Request URI
-
-POST /organizations|orgs/{org\_name}|{org\_uuid}/apps {request body}
-
-#### Parameters
-
-Parameter
-
-Description
-
-request body
-
-The following set of organization properties supplied through a form:.
-
-Property
-
-Description
-
-access token (string)
-
-The OAuth2 access token.
-
-name (string)
-
-The name of the application.
-
- 
-
-#### Example - Request
-
--   [cURL](#curl_create_org_app)
--   [JavaScript (HTML5)](#javascript_create_org_app)
--   [Ruby](#ruby_create_org_app)
--   [Node.js](#nodejs_create_org_app)
-
-<!-- -->
-
-    curl -X -i POST "https://api.usergrid.com/management/orgs/testorg/apps" -d '{"access_token":"YWMtmNIFFBI6EeKvXSIACowF7QAAATpL0bVQtGOWe8PMwLfQ9kD_VKQa7IH4UBQ","name":"testapp1"}'
-
-It is recommended that you use the [Admin
-Portal](http://apigee.com/usergrid) for administrative activities
-instead of using JavaScript to do them programmatically in your app.
-
-**Note:**You can see the response below in the Admin Portal by using the
-[JavaScript
-Console](/docs/usergrid/content/displaying-app-services-api-calls-curl-commands).
-
- 
-
-The example assumes use of the [Ruby
-SDK](https://github.com/scottganyo/usergrid_iron).
-
-    mgmt = Usergrid::Management.new 'https://api.usergrid.com/'
-    mynewapp = mgmt['orgs/testorg/apps'].create name: 'testapp1', access_token: 'YWMtmNIFFBI6EeKvXSIACowF7QAAATpL0bVQtGOWe8PMwLfQ9kD_VKQa7IH4UBQ'
-
-The example assumes use of the [Node.js
-module](https://github.com/apigee/usergrid-node-module).
-
-    var options = {
-        method:'POST',
-        endpoint:'management/orgs/testorg/apps',
-        body:{ 
-              access_token:'YWMtmNIFFBI6EeKvXSIACowF7QAAATpL0bVQtGOWe8PMwLfQ9kD_VKQa7IH4UBQ', 
-              name:'testapp1' 
-        }    
-    };
-    client.request(options, function (err, data) {
-        if (err) {
-            //error — POST failed
-        } else {
-            //success — data will contain raw results from API call        
-        }
-    });
-
-#### Example - Response
-
-    {
-      "action": "new application for organization",
-      "timestamp": 1338914698135,
-      "duration": 701
-    }
-
-### Deleting an organization application
-
-Use the DELETE method to delete an application from an organization.
-
-#### Request URI
-
-DELETE
-/organizations|orgs/{org\_name}|{org\_uuid}/apps/{app\_name}|{app\_uuid}
-
-Parameters
-
-  Parameter                   Description
-  --------------------------- -----------------------------------------
-  string org\_name|arg uuid   Organization name or organization UUID.
-  string app\_name|arg uuid   Application name or application UUID.
-
-**Note:** You also need to provide a valid access token with the API
-call. See [Authenticating users and application
-clients](/authenticating-users-and-application-clients) for details.
-
- 
-
-#### Example - Request
-
--   [cURL](#curl_delete_org_app)
--   [JavaScript (HTML5)](#javascript_delete_org_app)
--   [Ruby](#ruby_delete_org_app)
--   [Node.js](#nodejs_delete_org_app)
-
-<!-- -->
-
-    curl -X DELETE "https://api.usergrid.com/management/orgs/testorg/apps/testapp1"
-
-It is recommended that you use the [Admin
-Portal](http://apigee.com/usergrid) for administrative activities
-instead of using JavaScript to do them programmatically in your app.
-
-**Note:**You can see the response below in the Admin Portal by using the
-[JavaScript
-Console](/docs/usergrid/content/displaying-app-services-api-calls-curl-commands).
-
- 
-
-The example assumes use of the [Ruby
-SDK](https://github.com/scottganyo/usergrid_iron).
-
-    mgmt = Usergrid::Management.new 'https://api.usergrid.com/'
-    mgmt['orgs/testorg/apps/testapp1'].delete
-
-The example assumes use of the [Node.js
-module](https://github.com/apigee/usergrid-node-module).
-
-    var options = {
-        method:'DELETE',
-        endpoint:'management/orgs/testorg/apps/testapp1'
-    };
-    client.request(options, function (err, data) {
-        if (err) {
-            //error — DELETE failed
-        } else {
-            //success — data will contain raw results from API call       
-        }
-    });
-
-#### Example - Response
-
-    {
-      "action": "delete application from organization",
-      "timestamp": 1349817715666,
-      "duration": 0
-    }
-
-### Generating application credentials
-
-Use the POST method to generate the client ID and client secret
-credentials for an application in an organization.
-
-#### Request URI
-
-POST
-/organizations|orgs/{org\_name}|{uuid}/applications|apps/{app\_name}|{uuid}/credentials
-
-Parameters
-
-  Parameter                   Description
-  --------------------------- -----------------------------------------
-  string org\_name|arg uuid   Organization name or organization UUID.
-  string app\_name|arg uuid   Application name or application UUID.
-
-**Note:** You also need to provide a valid access token with the API
-call. See [Authenticating users and application
-clients](/authenticating-users-and-application-clients) for details.
-
- 
-
-#### Example - Request
-
--   [cURL](#curl_gen_app_credentials)
--   [JavaScript (HTML5)](#javascript_gen_app_credentials)
--   [Ruby](#ruby_gen_app_credentials)
--   [Node.js](#nodejs_gen_app_credentials)
-
-<!-- -->
-
-    curl -X POST "https://api.usergrid.com/management/orgs/testorg/apps/testapp1/credentials"
-
-It is recommended that you use the [Admin
-Portal](http://apigee.com/usergrid) for administrative activities
-instead of using JavaScript to do them programmatically in your app.
-
-**Note:**You can see the response below in the Admin Portal by using the
-[JavaScript
-Console](/docs/usergrid/content/displaying-app-services-api-calls-curl-commands).
-
-The example assumes use of the [Ruby
-SDK](https://github.com/scottganyo/usergrid_iron).
-
-    mgmt = Usergrid::Management.new 'https://api.usergrid.com/'
-    mgmt['orgs/testorg/apps/testapp1/credentials'].create
-
-The example assumes use of the [Node.js
-module](https://github.com/scottganyo/usergrid_iron).
-
-    var options = {
-        method:'POST',
-        endpoint:'management/orgs/testorg/apps/testapp1/credentials'
-    };
-    client.request(options, function (err, data) {
-        if (err) {
-            //error — POST failed
-        } else {
-            //success — data will contain raw results from API call       
-        }
-    });
-
-#### Example - Response
-
-    {
-      "action": "generate application client credentials",
-      "timestamp": 1349815979529,
-      "duration": 535,
-      "credentials":  {
-        "client_id": "YXA7ygil-f3TEeG-yhIxPQK1cQ",
-        "client_secret": "YXA65gYlqja8aYYSAy8Ox3Vg5aRZp48"
-      }
-    }
-
-### Getting application credentials
-
-Use the GET method to retrieve the client ID and client secret
-credentials for an application in an organization.
-
-#### Request URI
-
-GET
-/organizations|orgs/{org\_name}|{uuid}/applications|apps/{app\_name}|{uuid}/credentials
-
-Parameters
-
-  Parameter                   Description
-  --------------------------- -----------------------------------------
-  string org\_name|arg uuid   Organization name or organization UUID.
-  string app\_name|arg uuid   Application name or application UUID.
-
-**Note:** You also need to provide a valid access token with the API
-call. See [Authenticating users and application
-clients](/authenticating-users-and-application-clients) for details.
-
- 
-
-#### Example - Request
-
--   [cURL](#curl_get_app_credentials)
--   [JavaScript (HTML5)](#javascript_get_app_credentials)
--   [Ruby](#ruby_get_app_credentials)
--   [Node.js](#nodejs_get_app_credentials)
-
-<!-- -->
-
-    curl -X GET "https://api.usergrid.com/management/orgs/testorg/apps/testapp1/credentials"
-
-It is recommended that you use the [Admin
-Portal](http://apigee.com/usergrid) for administrative activities
-instead of using JavaScript to do them programmatically in your app.
-
-**Note:**You can see the response below in the Admin Portal by using the
-[JavaScript
-Console](/docs/usergrid/content/displaying-app-services-api-calls-curl-commands).
-
-The example assumes use of the [Ruby
-SDK](https://github.com/scottganyo/usergrid_iron).
-
-    mgmt = Usergrid::Management.new 'https://api.usergrid.com/'
-    mgmt['orgs/testorg/apps/testapp1/credentials']
-
-The example assumes use of the [Node.js
-module](https://github.com/apigee/usergrid-node-module).
-
-    var options = {
-        method:'GET',
-        endpoint:'management/orgs/testorg/apps/testapp1/credentials'
-    };
-    client.request(options, function (err, data) {
-        if (err) {
-            //error — GET failed
-        } else {
-            //success — data will contain raw results from API call       
-        }
-    });
-
-#### Example - Response
-
-    {
-      "action": "get application client credentials",
-      "timestamp": 1349816819545,
-      "duration": 7,
-      "credentials":  {
-        "client_id": "YXA7ygil-f3TEeG-yhIxPQK1cQ",
-        "client_secret": "YXA65gYlqja8aYYSAy8Ox3Vg5aRZp48"
-      }
-    }
-
-### Getting the applications in an organization
-
-Use the GET method to retrieve the applications in an organization.
-
-#### Request URI
-
-GET /organizations|orgs/{org\_name}|{uuid}/applications|apps
-
-Parameters
-
-  Parameter                   Description
-  --------------------------- -----------------------------------------
-  string org\_name|arg uuid   Organization name or organization UUID.
-
-**Note:** You also need to provide a valid access token with the API
-call. See [Authenticating users and application
-clients](/authenticating-users-and-application-clients) for details.
-
- 
-
-#### Example - Request
-
--   [cURL](#curl_get_apps_org)
--   [JavaScript (HTML5)](#javascript_get_apps_org)
--   [Ruby](#ruby_get_apps_org)
--   [Node.js](#nodejs_get_apps_org)
-
-<!-- -->
-
-    curl -X GET "https://api.usergrid.com/management/orgs/testorg/apps"
-
-It is recommended that you use the [Admin
-Portal](http://apigee.com/usergrid) for administrative activities
-instead of using JavaScript to do them programmatically in your app.
-
-**Note:**You can see the response below in the Admin Portal by using the
-[JavaScript
-Console](/docs/usergrid/content/displaying-app-services-api-calls-curl-commands).
-
- 
-
-The example assumes use of the [Ruby
-SDK](https://github.com/scottganyo/usergrid_iron).
-
-    mgmt = Usergrid::Management.new 'https://api.usergrid.com/'
-    apps = mgmt['orgs/testorg/apps'].collection
-
-The example assumes use of the [Node.js
-module](https://github.com/apigee/usergrid-node-module).
-
-    var options = {
-        method:'GET',
-        endpoint:'management/orgs/testorg/apps'
-    };
-    client.request(options, function (err, data) {
-        if (err) {
-            //error — GET failed
-        } else {
-            //success — data will contain raw results from API call       
-        }
-    });
-
- 
-
-#### Example - Response
-
-    {
-      "action": "get organization application",
-      "data":  {
-        "testorg/sandbox": "3500ba10-cd0c-11e1-bcf8-12313d1c5591",
-        "testorg/testapp1": "be09a5f9-fdd3-11e1-beca-12313d027361",
-        "testorg/testapp2": "cede5b8e-fe90-11e1-65c8-12313b111c56"    
-      },
-      "timestamp": 1349815338635,
-      "duration": 22
-    }
-
-### Adding an admin user to an organization
-
-Use the PUT method to add an existing admin user to an organization.
-
-#### Request URI
-
-PUT
-/organizations|orgs/{org\_name}|{org\_uuid}/users/{username|email|uuid}
-
-#### Parameters
-
-  Parameter                               Description
-  --------------------------------------- ----------------------------------------------
-  string org\_name|arg org\_uuid          Organization name or organization UUID.
-  string username|string email|arg uuid   User name, user email address, or user UUID.
-
- 
-
-#### Example - Request
-
--   [cURL](#curl_add_admin_user)
--   [JavaScript (HTML5)](#javascript_add_admin_user)
--   [Ruby](#ruby_add_admin_user)
--   [Node.js](#nodejs_add_admin_user)
-
-<!-- -->
-
-    curl -X PUT "https://api.usergrid.com/management/orgs/testorg/users/test123"
-
-It is recommended that you use the [Admin
-Portal](http://apigee.com/usergrid) for administrative activities
-instead of using JavaScript to do them programmatically in your app.
-
-**Note:**You can see the response below in the Admin Portal by using the
-[JavaScript
-Console](/docs/usergrid/content/displaying-app-services-api-calls-curl-commands).
-
-The example assumes use of the [Ruby
-SDK](https://github.com/scottganyo/usergrid_iron).
-
-    mgmt = Usergrid::Management.new 'https://api.usergrid.com/'
-    mgmt['orgs/testorg/users/test123'].put nil
-
-The example assumes use of the [Node.js
-module](https://github.com/apigee/usergrid-node-module).
-
-    var options = {
-        method:'PUT',
-        endpoint:'management/orgs/testorg/users/test123'
-    };
-    client.request(options, function (err, data) {
-        if (err) {
-            //error — PUT failed
-        } else {
-            //success — data will contain raw results from API call       
-        }
-    });
-
-#### Example - Response
-
-    {
-      "action": "add user to organization",
-      "status": "ok",
-      "data":  {
-        "user":  {
-          "applicationId": "00000000-0000-0000-0000-000000000001",
-          "username": "tester123",
-          "name": "test",
-          "email": "tester123@hotmail.com",
-          "activated": true,
-          "disabled": false,
-          "uuid": "335b527f-cd0d-11e1-bef8-12331d1c5591",
-          "adminUser": true,
-          "displayEmailAddress": "tester123 <te...@hotmail.com>",
-          "htmldisplayEmailAddress": "tester123 <<a href="mailto:tester123@hotmail.com">tester123@hotmail.com</a>>"
-        }
-      },
-      "timestamp": 1349390189106,
-      "duration": 11808
-    }
-
-### Getting the admin users in an organization
-
-Use the GET method to retrieve details about the admin users in an
-organization.
-
-#### Request URI
-
-GET /organizations|orgs/{org\_name}|{org\_uuid}/users
-
-#### Parameters
-
-  Parameter                        Description
-  -------------------------------- -----------------------------------------
-  string org\_name|arg org\_uuid   Organization name or organization UUID.
-
- 
-
-#### Example - Request
-
--   [cURL](#curl_get_admin_users)
--   [JavaScript (HTML5)](#javascript_get_admin_users)
--   [Ruby](#ruby_get_admin_users)
--   [Node.js](#nodejs_get_admin_users)
-
-<!-- -->
-
-    curl -X GET "https://api.usergrid.com/management/orgs/testorg/users"
-
-It is recommended that you use the [Admin
-Portal](http://apigee.com/usergrid) for administrative activities
-instead of using JavaScript to do them programmatically in your app.
-
-**Note:**You can see the response below in the Admin Portal by using the
-[JavaScript
-Console](/docs/usergrid/content/displaying-app-services-api-calls-curl-commands).
-
-The example assumes use of the [Ruby
-SDK](https://github.com/scottganyo/usergrid_iron).
-
-    mgmt = Usergrid::Management.new 'https://api.usergrid.com/'
-    admins = mgmt['orgs/testorg/users']
-
-The example assumes use of the [Node.js
-module](https://github.com/apigee/usergrid-node-module).
-
-    var options = {
-        method:'GET',
-        endpoint:'management/orgs/testorg/users'
-    };
-    client.request(options, function (err, data) {
-        if (err) {
-            //error — GET failed
-        } else {
-            //success — data will contain raw results from API call       
-        }
-    });
-
-#### Example - Response
-
-    {
-      "action": "get organization users",
-      "data":  {
-        "user":  {
-          "applicationId": "00000000-0000-0000-0000-000000000001",
-          "username": "tester123",
-          "name": "test",
-          "email": "tester123@hotmail.com",
-          "activated": true,
-          "disabled": false,
-          "uuid": "335b527f-cd0d-11e1-bef8-12331d1c5591",
-          "adminUser": true,
-          "displayEmailAddress": "tester123 <te...@hotmail.com>",
-          "htmldisplayEmailAddress": "tester123 <<a href="mailto:tester123@hotmail.com">tester123@hotmail.com</a>>"
-        }
-      },
-      "timestamp": 13494542201685,
-      "duration": 10
-    }
-
-### Removing an admin user from an organization
-
-Use the DELETE method to remove an admin user from an organization.
-
-#### Request URI
-
-DELETE
-/organizations|orgs/{org\_name}|{org\_uuid}/users/{username|email|uuid}
-
-#### Parameters
-
-  Parameter                               Description
-  --------------------------------------- ----------------------------------------------
-  string org\_name|arg org\_uuid          Organization name or organization UUID.
-  string username|string email|arg uuid   User name, user email address, or user UUID.
-
- 
-
-#### Example - Request
-
--   [cURL](#curl_delete_admin_user)
--   [JavaScript (HTML5)](#javascript_delete_admin_user)
--   [Ruby](#ruby_delete_admin_user)
--   [Node.js](#nodejs_delete_admin_user)
-
-<!-- -->
-
-    curl -X DELETE "https://api.usergrid.com/management/orgs/testorg/users/test123"
-
-It is recommended that you use the [Admin
-Portal](http://apigee.com/usergrid) for administrative activities
-instead of using JavaScript to do them programmatically in your app.
-
-**Note:**You can see the response below in the Admin Portal by using the
-[JavaScript
-Console](/docs/usergrid/content/displaying-app-services-api-calls-curl-commands).
-
-The example assumes use of the [Ruby
-SDK](https://github.com/scottganyo/usergrid_iron).
-
-    mgmt = Usergrid::Management.new 'https://api.usergrid.com/'
-    mgmt['orgs/testorg/users/test123'].delete
-
-The example assumes use of the [Node.js
-module](https://github.com/apigee/usergrid-node-module).
-
-    var options = {
-        method:'DELETE',
-        endpoint:'management/orgs/testorg/users/test123'
-    };
-    client.request(options, function (err, data) {
-        if (err) {
-            //error — DELETE failed
-        } else {
-            //success — data will contain raw results from API call       
-        }
-    });
-
-#### Example - Response
-
-    {
-      "action": "remove user from organization",
-      "status": "ok",
-      "data":  {
-        "user":  {
-          "applicationId": "00000000-0000-0000-0000-000000000001",
-          "username": "tester123",
-          "name": "test",
-          "email": "tester123@hotmail.com",
-          "activated": true,
-          "disabled": false,
-          "uuid": "335b527f-cd0d-11e1-bef8-12331d1c5591",
-          "adminUser": true,
-          "displayEmailAddress": "tester123 <te...@hotmail.com>",
-          "htmldisplayEmailAddress": "tester123 <<a href="mailto:tester123@hotmail.com">tester123@hotmail.com</a>>"
-        }
-      },
-      "timestamp": 1349453590005,
-      "duration": 727
-    }
-
-
-
 Admins
 ------
 
-[See all management
-resources](/docs/usergrid/content/management-resources)[![](/docs/sites/docs/files/learnmore%20arrow_0.png)](/docs/usergrid/content/management-resources)
 
 An admin user has full access to perform any operation on all
 organization accounts of which the admin user is a member. Using the App
 services API, you can create, update, or retrieve an admin user. You can
 also set or reset an admin user's password, activite or reactivate an
-admin user, and get an admin user's activity feed.
-
-In addition, you can add,  retrieve, or remove an admin user from an
-organization. For information on these organization-related operations,
-see [Organization](/organization).
-
-**Note:** Although not shown in the API examples below, you need to
-provide a valid access token with each API call. See [Authenticating
-users and application
-clients](/authenticating-users-and-application-clients) for details.
-
-### Creating an admin user
-
-Use the POST method to create an admin user.
-
-#### Request URI
-
-POST /management/organizations/{org}/users {request body}
-
-#### Parameters
-
-+--------------------------------------+--------------------------------------+
-| Parameter                            | Description                          |
-+======================================+======================================+
-| request body                         | One or more sets of user properties, |
-|                                      | of which username is mandatory and   |
-|                                      | must be unique:                      |
-|                                      |                                      |
-|                                      |     {                                |
-|                                      |       "username" : "jim.admin",      |
-|                                      |       "email" : "jim.admin@gmail.com |
-|                                      | ",                                   |
-|                                      |       "name" : "Jim Admin",          |
-|                                      |       "password" : "test12345"       |
-|                                      |     }                                |
-+--------------------------------------+--------------------------------------+
-
- 
-
-#### Example - Request
-
--   [cURL](#curl_create_admin_user)
--   [JavaScript (HTML5)](#javascript_create_admin_user)
--   [Ruby](#ruby_create_admin_user)
--   [Node.js](#nodejs_create_admin_user)
-
-<!-- -->
-
-    curl -X -i POST "https://api.usergrid.com/management/organizations/my-org/users" -d '{"username":"jim.admin","name":"Jim Admin","email":"jim.admin@gmail.com","password":"test12345"}'
-
-It is recommended that you use the [Admin
-Portal](http://apigee.com/usergrid) for administrative activities
-instead of using JavaScript to do them programmatically in your app.
-
-**Note:**You can see the response below in the Admin Portal by using the
-[JavaScript
-Console](/docs/usergrid/content/displaying-app-services-api-calls-curl-commands).
-
-The example assumes use of the [Ruby
-SDK](https://github.com/scottganyo/usergrid_iron).
-
-    mgmt = Usergrid::Management.new 'https://api.usergrid.com/management/organizations/my-org/'
-    result = mgmt.create_user username: 'jim.admin', name: 'Jim Admin', email: 'jim.admin@gmail.com', password: 'test12345'
-    jim_admin = result.entity
-
-The example assumes use of the [Node.js
-module](https://github.com/apigee/usergrid-node-module).
-
-    var options = {
-        method:'POST',
-        endpoint:'management/organizations/my-org/users',
-        body:{ username:'jim.admin', name:'Jim Admin', email:'jim.admin@gmail.com',  
-        password:'test12345' }
-    };
-    client.request(options, function (err, data) {
-        if (err) {
-            //error — POST failed
-        } else {
-            //success — data will contain raw results from API call        
-        }
-    });
-
-#### Example - Response
-
-    {
-      "action": "post",
-      "status": "ok",
-      "data":  {
-        "user":  {
-          "applicationId": "00000000-0000-0000-0000-000000000001",
-          "username": "jim.admin",
-          "name": "Jim Admin",
-          "email": "jim.admin@gmail.com",
-          "activated": true,
-          "disabled": false,
-          "uuid": "335b527f-cd0d-11e1-bef8-12331d1c5591",
-          "adminUser": true,
-          "displayEmailAddress": "jim.admin <ji...@gmail.com>",
-          "htmldisplayEmailAddress": "jim.admin <a href="mailto:jim.admin@gmail.com">jinm.admin@gmail.com</a>"
-        }
-      },
-      "timestamp": 1349390189106,
-      "duration": 11808
-    }
-
-### Updating an admin user
-
-Use the PUT method to update an admin user.
-
-#### Request URI
-
-PUT /management/organizations/{org}/users/{user|username|email|uuid}
-{request body}
-
-#### Parameters
-
-+--------------------------------------+--------------------------------------+
-| Parameter                            | Description                          |
-+======================================+======================================+
-| string user|string username|string   | Admin username, name, email address, |
-| email|arg uuid                       | or UUID.                             |
-+--------------------------------------+--------------------------------------+
-| request body                         | One or more sets of user properties: |
-|                                      |                                      |
-|                                      |     {                                |
-|                                      |       "city" : "San Francisco",      |
-|                                      |       "state" : "California"         |
-|                                      |     }                                |
-+--------------------------------------+--------------------------------------+
-
- 
-
-#### Example - Request
-
--   [cURL](#curl_update_admin_user)
--   [JavaScript (HTML5)](#javascript_update_admin_user)
--   [Ruby](#ruby_update_admin_user)
--   [Node.js](#nodejs_update_admin_user)
-
-<!-- -->
-
-    curl -X -i PUT "https://api.usergrid.com/management/organizations/my-org/users/jim.admin" -d '{"city":"San Francisco","state":"California"}'
-
-It is recommended that you use the [Admin
-Portal](http://apigee.com/usergrid) for administrative activities
-instead of using JavaScript to do them programmatically in your app.
-
-**Note:**You can see the response below in the Admin Portal by using the
-[JavaScript
-Console](/docs/usergrid/content/displaying-app-services-api-calls-curl-commands).
-
-The example assumes use of the [Ruby
-SDK](https://github.com/scottganyo/usergrid_iron).
-
-    mgmt = Usergrid::Management.new 'https://api.usergrid.com/management/organizations/my-org/'
-    jim_admin = mgmt['users/jim.admin'].entity
-    jim_admin.city = 'San Francisco'
-    jim_admin.state = 'California'
-    jim_admin.save
-
-The example assumes use of the [Node.js
-module](https://github.com/apigee/usergrid-node-module).
-
-    var options = {
-        method:'PUT',
-        endpoint:'management/organizations/my-org/users/jim.admin',
-        body:{ email:'john.doe@mail.com', city:'San Francisco', state:'California' }
-    };
-    client.request(options, function (err, data) {
-        if (err) {
-            //error — PUT failed
-        } else {
-            //success — data will contain raw results from API call        
-        }
-    });
-
-#### Example - Response
-
-    {
-      "action": "update user info",
-      "timestamp": 1349479321874,
-      "duration": 0
-    }
-
-### Getting an admin user
-
-Use the GET method to retrieve details about an admin user.
-
-#### Request URI
-
-GET /management/organizations/{org}/users/{user|username|email|uuid}
-
-#### Parameters
-
-  Parameter                                           Description
-  --------------------------------------------------- -----------------------------------------------
-  string user|string username|string email|arg uuid   Admin username, name, email address, or UUID.
-
- 
-
-#### Example - Request
-
--   [cURL](#curl_get_admin_user)
--   [JavaScript (HTML5)](#javascript_get_admin_user)
--   [Ruby](#ruby_get_admin_user)
--   [Node.js](#nodejs_get_admin_user)
-
-<!-- -->
-
-    curl -X GET "https://api.usergrid.com/management/organizations/my-org/users/jim.admin"
-
-It is recommended that you use the [Admin
-Portal](http://apigee.com/usergrid) for administrative activities
-instead of using JavaScript to do them programmatically in your app.
-
-**Note:**You can see the response below in the Admin Portal by using the
-[JavaScript
-Console](/docs/usergrid/content/displaying-app-services-api-calls-curl-commands).
-
-The example assumes use of the [Ruby
-SDK](https://github.com/scottganyo/usergrid_iron).
-
-    mgmt = Usergrid::Management.new 'https://api.usergrid.com/management/organizations/my-org/'
-    jim_admin = mgmt['users/jim.admin'].entity
-
-The example assumes use of the [Node.js
-module](https://github.com/apigee/usergrid-node-module).
-
-    var options = {
-        method:'GET',
-        endpoint:'management/organizations/my-org/users/jim.admin'
-    };
-    client.request(options, function (err, data) {
-        if (err) {
-            //error — GET failed
-        } else {
-            //success — data will contain raw results from API call       
-        }
-    });
-
-#### Example - Response
-
-    {
-      "action": "get admin user",
-      "status": "ok",
-      "data":  {
-        "username": "jim.admin",
-        "token": "YWMt4NqE8Q9GEeLYJhIxPSiO4AAAATo5fQfcG0cEd2h9nwmDmRorkNNrEeQyDOF",
-        "email": "edort1@gmail.com",
-        "organizations":  {
-          "jim.admin":  {
-            "users":  {
-              "jim.admin":  {
-                "applicationId": "00000000-0000-0000-0000-000000000001",
-                "username": "jim.admin",
-                "name": "Jim Admin",
-                "email": "jim.admin@gmail.com",
-                "activated": true,
-                "disabled": false,
-                "uuid": "328b526e-cd0c-11e1-bcf8-12424d1c4491",
-                "adminUser": true,
-                "displayEmailAddress": "jim.admin <ji...@gmail.com>",
-                "htmldisplayEmailAddress": "jim.admin <<a href="mailto:jim.admin@gmail.com">jim.admin@gmail.com>"
-        },
-        ...
-        "adminUser": true,
-        "activated": true,
-        "name": "edort1",
-        "applicationId": "00000000-0000-0000-0000-000000000001",
-        "uuid": "328b526e-cd0c-11e1-bcf8-12424d1c4491",
-        "htmldisplayEmailAddress": "jim.admin <<a href="mailto:jim.admin@gmail.com">jim.admin@gmail.com>>",
-        "displayEmailAddress": "jim.admin <ji...@gmail.com>",
-        "disabled": false
-      },
-      "timestamp": 1349480786906,
-
-### Setting an admin user's password
-
-Use the PUT method to update an admin user's password.
-
-#### Request URI
-
-PUT
-/management/organizations/{org}/users/{user|username|email|uuid}/password
-{request body}
-
-#### Parameters
-
-+--------------------------------------+--------------------------------------+
-| Parameter                            | Description                          |
-+======================================+======================================+
-| string user|string username|string   | Admin username, name, email address, |
-| email|arg uuid                       | or UUID.                             |
-+--------------------------------------+--------------------------------------+
-| request body                         | The password property and value:     |
-|                                      |                                      |
-|                                      |     {                                |
-|                                      |       "password": "test123"          |
-|                                      |     }                                |
-+--------------------------------------+--------------------------------------+
-
- 
-
-#### Example - Request
-
--   [cURL](#curl_set_admin_pw)
--   [JavaScript (HTML5)](#javascript_set_admin_pw)
--   [Ruby](#ruby_set_admin_pw)
--   [Node.js](#nodejs_set_admin_pw)
-
-<!-- -->
-
-    curl -X -i PUT "https://api.usergrid.com/management/organizations/my-org/users/jim.admin/password" -d '{"password":"test123"}'
-
-It is recommended that you use the [Admin
-Portal](http://apigee.com/usergrid) for administrative activities
-instead of using JavaScript to do them programmatically in your app.
-
-**Note:**You can see the response below in the Admin Portal by using the
-[JavaScript
-Console](/docs/usergrid/content/displaying-app-services-api-calls-curl-commands).
-
- 
-
-The example assumes use of the [Ruby
-SDK](https://github.com/scottganyo/usergrid_iron).
-
-    mgmt = Usergrid::Management.new 'https://api.usergrid.com/management/organizations/my-org'
-    jim_admin = mgmt['users/jim.admin'].entity
-    jim_admin.password = 'test123'
-    jim_admin.save
-
-The example assumes use of the [Node.js
-module](https://github.com/apigee/usergrid-node-module).
-
-    var options = {
-        method:'PUT',
-        endpoint:'management/organizations/my-org/users/jim.admin',
-        body:{ password:'test123' }
-    };
-    client.request(options, function (err, data) {
-        if (err) {
-            //error — PUT failed
-        } else {
-            //success — data will contain raw results from API call       
-        }
-    });
-
-#### Example - Response
-
-    {
-      "action": "set user password",
-      "timestamp": 1349714010142,
-      "duration": 0
-    }
-
-### Resetting an admin user's password
-
-Resetting an admin user's password is a two step process. In the first
-step, you initiate the password reset. This returns a browser page. The
-page includes a field for the user to enter his or her email address,
-and a field to enter a response to a Captcha challenge. In the second
-step, you handle the user's responses from the form.
-
-#### Initiating a password reset
-
-Use the GET method to initiate the password reset.
-
-#### Request URI
-
-GET /management/organizations/{org}/users/resetpw
-
-#### Example - Request
-
--   [cURL](#curl_init_pw_reset)
--   [JavaScript (HTML5)](#javascript_init_pw_reset)
--   [Ruby](#ruby_init_pw_reset)
--   [Node.js](#nodejs_init_pw_reset)
-
-<!-- -->
-
-    curl -X GET "https://api.usergrid.com/management/organizations/my-org/users/resetpw"
-
-It is recommended that you use the [Admin
-Portal](http://apigee.com/usergrid) for administrative activities
-instead of using JavaScript to do them programmatically in your app.
-
-**Note:**You can see the response below in the Admin Portal by using the
-[JavaScript
-Console](/docs/usergrid/content/displaying-app-services-api-calls-curl-commands).
-
-The example assumes use of the [Ruby
-SDK](https://github.com/scottganyo/usergrid_iron).
-
-    mgmt = Usergrid::Management.new 'https://api.usergrid.com/management/organizations/my-org/'
-    resetpw = mgmt['users/resetpw']
-
-The example assumes use of the [Node.js
-module](https://github.com/apigee/usergrid-node-module).
-
-    var options = {
-        method:'GET',
-        endpoint:'management/organizations/my-org/users/resetpw'
-    };
-    client.request(options, function (err, data) {
-        if (err) {
-            //error — GET failed
-        } else {
-            //success — data will contain raw results from API call       
-        }
-    });
-
-#### Example - Response
-
-    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-    <html>
-    <head>
-        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-        <title>Reset Password</title>
-        <link rel="stylesheet" type="text/css" href="../../css/styles.css" />
-        <script type="text/javascript">>
-            var RecaptchaOptions = {
-                theme : 'clean'
-            };
-        </script>
-    </head>
-    <body>
-
-        <div class="dialog-area">
-            <div class="dialog-form-message">Incorrect Captcha, try again...</div>
-            <form class="dialog-form" action="" method="post">
-                <fieldset>
-                    <p>
-                        <label for="email">Please type your <strong>email
-                                address</strong> or <strong>username</strong> below.</label>
-                    </p>
-                    <p>
-                        <input class="text_field" id="email" name="email" type="text" />
-                    </p>
-                    <p id="human-proof"></p>
-                    <script type="text/javascript" src="https://www.google.com/recaptcha/api/challenge?k=6LdSTNESAAAAAKHdVglHmMu86_EoYxsJjqQD1IpZ"></script>
-
-                    <p class="buttons">
-                        <button type="submit">Submit</button>
-                    </p>
-                </fieldset>
-            </form>
-        </div>
-    </pre>
-
-#### Completing a password reset
-
-Use the POST method to complete the password reset.
-
-#### Request URI
-
-POST /management/organizations/{org}/users/resetpw {request body}
-
-#### Parameters
-
-+--------------------------------------+--------------------------------------+
-| Parameter                            | Description                          |
-+======================================+======================================+
-| request body                         | Parameters and value for the Captcha |
-|                                      | challenge, the admin user's response |
-|                                      | to the Captcha challenge, and the    |
-|                                      | admin user's email address, for      |
-|                                      | example:                             |
-|                                      |                                      |
-|                                      |     {                                |
-|                                      |       "recaptcha_response_field" : " |
-|                                      | Atistophanes tseFia",                |
-|                                      |       "recaptcha_challenge_field" :  |
-|                                      | "Atistophanes tseFia",               |
-|                                      |       "email" : "jim.admin@gmail.com |
-|                                      | "                                    |
-|                                      |     }                                |
-+--------------------------------------+--------------------------------------+
-
- 
-
-#### Example - Request
-
--   [cURL](#curl_complete_pw_reset)
--   [JavaScript (HTML5)](#javascript_complete_pw_reset)
--   [Ruby](#ruby_complete_pw_reset)
--   [Node.js](#nodejs_complete_pw_reset)
-
-<!-- -->
-
-    curl -X -i POST "https://api.usergrid.com/management/organizations/my-org/users/resetpw" -d '{"recaptcha_response_field":"Atistophanes tseFia","recaptcha_challenge_field":"Atistophanes tseFia","email":"jim.admin@gmail.com"}'
-
-It is recommended that you use the [Admin
-Portal](http://apigee.com/usergrid) for administrative activities
-instead of using JavaScript to do them programmatically in your app.
-
-**Note:**You can see the response below in the Admin Portal by using the
-[JavaScript
-Console](/docs/usergrid/content/displaying-app-services-api-calls-curl-commands).
-
- 
-
-The example assumes use of the [Ruby
-SDK](https://github.com/scottganyo/usergrid_iron).
-
-    mgmt = Usergrid::Management.new 'https://api.usergrid.com/management/organizations/my-org/'
-    resetpw = mgmt['users/resetpw']
-    resetpw { recaptcha_response_field: 'Atistophanes tseFia', recaptcha_challenge_field: 'Atistophanes tseFia', email: 'jim.admin@gmail.com' }
-
-The example assumes use of the [Node.js
-module](https://github.com/apigee/usergrid-node-module).
-
-    var options = {
-        method:'POST',
-        endpoint:'management/organizations/my-org/users/resetpw',
-        body:{ 
-           recaptcha_response_field:'Atistophanes tseFia', 
-           recaptcha_challenge_field:'Atistophanes tseFia', 
-           email:'jim.admin@gmail.com' 
-        }
-    };
-    client.request(options, function (err, data) {
-        if (err) {
-            //error — POST failed
-        } else {
-            //success — data will contain raw results from API call       
-        }
-    });
-
-#### Example - Response
-
-    {
-      "action": "reset user password",
-      "timestamp": 13546154010321,
-      "duration": 0
-    }
-
-### Activating an admin user
-
-Use the GET method to activate an admin user from a link provided in an
-email notification.
-
-#### Request URI
-
-GET
-/management/organizations/{org}/users/{user|username|email|uuid}/activate?token={token}&confirm={confirm\_email}
-
-#### Parameters
-
-  Parameter                                           Description
-  --------------------------------------------------- -------------------------------------------------
-  string user|string username|string email|arg uuid   Admin username, name, email address, or UUID.
-  string token                                        Activation token (supplied via email).
-  boolean confirm\_email                              Send confirmation email (false is the default).
-
- 
-
-#### Example - Request
-
--   [cURL](#curl_activate_admin_user)
--   [JavaScript (HTML5)](#javascript_activate_admin_user)
--   [Ruby](#ruby_activate_admin_user)
--   [Node.js](#nodejs_activate_admin_user)
-
-<!-- -->
-
-    curl -X GET "https://api.usergrid.com/management/organizations/my-org/users/jim.admin/activate?token=33dd0563-cd0c-11e1-bcf7-12313d1c4491"
-
-It is recommended that you use the [Admin
-Portal](http://apigee.com/usergrid) for administrative activities
-instead of using JavaScript to do them programmatically in your app.
-
-**Note:**You can see the response below in the Admin Portal by using the
-[JavaScript
-Console](/docs/usergrid/content/displaying-app-services-api-calls-curl-commands).
-
-The example assumes use of the [Ruby
-SDK](https://github.com/scottganyo/usergrid_iron).
-
-    mgmt = Usergrid::Management.new 'https://api.usergrid.com/management/organizations/my-org/'
-    mgmt['users/jim.admin/activate'].get params: { token: '33dd0563-cd0c-11e1-bcf7-12313d1c4491' }
-
-The example assumes use of the [Node.js
-module](https://github.com/apigee/usergrid-node-module).
-
-    var options = {
-        method:'GET',
-        endpoint:'management/organizations/my-org/users/jim.admin/activate',
-        qs:{token:'33dd0563-cd0c-11e1-bcf7-12313d1c4491'}
-    };
-    client.request(options, function (err, data) {
-        if (err) {
-            //error — GET failed
-        } else {
-            //success — data will contain raw results from API call       
-        }
-    });
-
-#### Example - Response
-
-    {
-      "action": "activate user",
-      "timestamp": 1349718021324,
-      "duration": 0
-    }
-
-### Reactivating an admin user
-
-Use the GET method to reactivate an admin user.
-
-#### Request URI
-
-GET
-/management/organizations/{org}/users/{user|username|email|uuid}/reactivate
-
-#### Parameters
-
-  Parameter                                           Description
-  --------------------------------------------------- -----------------------------------------------
-  string user|string username|string email|arg uuid   Admin username, name, email address, or UUID.
-
- 
-
-#### Example - Request
-
--   [cURL](#curl_reactivate_admin_user)
--   [JavaScript (HTML5)](#javascript_reactivate_admin_user)
--   [Ruby](#ruby_reactivate_admin_user)
--   [Node.js](#nodejs_reactivate_admin_user)
-
-<!-- -->
-
-    curl -X GET "https://api.usergrid.com/management/organizations/my-org/users/jim.admin/reactivate"
-
-It is recommended that you use the [Admin
-Portal](http://apigee.com/usergrid) for administrative activities
-instead of using JavaScript to do them programmatically in your app.
-
-**Note:**You can see the response below in the Admin Portal by using the
-[JavaScript
-Console](/docs/usergrid/content/displaying-app-services-api-calls-curl-commands).
-
-The example assumes use of the [Ruby
-SDK](https://github.com/scottganyo/usergrid_iron).
-
-    mgmt = Usergrid::Management.new 'https://api.usergrid.com/management/organizations/my-org/'
-    mgmt['users/jim.admin/reactivate']
-
-The example assumes use of the [Node.js
-module](https://github.com/apigee/usergrid-node-module).
-
-    var options = {
-        method:'GET',
-        endpoint:'management/organizations/my-org/users/jim.admin/reactivate'
-    };
-    client.request(options, function (err, data) {
-        if (err) {
-            //error — GET failed
-        } else {
-            //success — data will contain raw results from API call       
-        }
-    });
-
-#### Example - Response
-
-    {
-      "action": "reactivate user",
-      "timestamp": 1349735217217,
-      "duration": 3541
-    }
-
-### Getting an admin user's activity feed
-
-Use the GET method to retrieve an admin user's activity feed.
-
-#### Request URI
-
-GET
-/management/organizations/{org}/users/{user|username|email|uuid}/feed
-
-#### Parameters
-
-  Parameter                                           Description
-  --------------------------------------------------- -----------------------------------------------
-  string user|string username|string email|arg uuid   Admin username, name, email address, or UUID.
-
-#### Example - Request
-
--   [cURL](#curl_get_user_feed)
--   [JavaScript (HTML5)](#javascript_get_user_feed)
--   [Ruby](#ruby_get_user_feed)
--   [Node.js](#nodejs_get_user_feed)
-
-<!-- -->
-
-    curl -X GET "https://api.usergrid.com/management/organizations/my-org/users/jim.admin/feed"
-
-It is recommended that you use the [Admin
-Portal](http://apigee.com/usergrid) for administrative activities
-instead of using JavaScript to do them programmatically in your app.
-
-**Note:**You can see the response below in the Admin Portal by using the
-[JavaScript
-Console](/docs/usergrid/content/displaying-app-services-api-calls-curl-commands).
-
-The example assumes use of the [Ruby
-SDK](https://github.com/scottganyo/usergrid_iron).
-
-    mgmt = Usergrid::Management.new 'https://api.usergrid.com/management/organizations/my-org/'
-    mgmt['users/jim.admin/feed'].get
-
-The example assumes use of the [Node.js
-module](https://github.com/apigee/usergrid-node-module).
-
-    var options = {
-        method:'GET',
-        endpoint:'management/organizations/my-org/users/jim.admin/feed'
-    };
-    client.request(options, function (err, data) {
-        if (err) {
-            //error — GET failed
-        } else {
-            //success — data will contain raw results from API call       
-        }
-    });
-
-#### Example - Response
-
-    {
-      "action": "get admin user feed",
-      "status": "ok",
-     "entities":  [
-         {
-          "uuid": "cf3e981c-fe80-11e1-95c8-12331b144c65",
-          "type": "activity",
-          "created": 1347643370454,
-          "modified": 1347643370454,
-          "actor":  {
-            "displayName": "jim.admin",
-            "objectType": "person",
-            "uuid": "335b527f-cd0d-11e1-bef8-12331d1c5591",
-            "entityType": "user"
-          },
-          "category": "admin",
-          "metadata":  {
-            "cursor": "gGkAAQMAgGkABgE5xc3r1gCAdQAQz02YHP6QEeGVyBIxOxIsVgCAdQAQz4ZbYf6QEeGVyBIxOxIsVgA",
-            "path": "/users/327b527f-cd0c-11e1-bcf7-12313d1c4491/feed/cf4d981c-fe90-11e1-95c8-12313b122c56"
-          },
-        "object":  {
-        ...
-        },
-        "published": 1342198809251,
-                "title": "<a mailto="jim.admingmail.com">jim.admin (jim.admin@gmail.com)</a> created a new organization account named jim.admin",
-                "verb": "create"
-              }
-            ],
-      "timestamp": 1349735719320,
+admin user, and get an admin user's activity feed.
\ No newline at end of file

Added: incubator/usergrid/site/content/docs/query-language.md
URL: http://svn.apache.org/viewvc/incubator/usergrid/site/content/docs/query-language.md?rev=1552550&view=auto
==============================================================================
--- incubator/usergrid/site/content/docs/query-language.md (added)
+++ incubator/usergrid/site/content/docs/query-language.md Fri Dec 20 09:15:11 2013
@@ -0,0 +1,465 @@
+---
+title: Query Language
+category: docs
+layout: docs
+---
+
+> Query examples in this content are shown unencoded to make
+> them easier to read. Keep in mind that you might need to encode query
+> strings if you're sending them as part of URLs, such as when you're
+> executing them with the cURL tool.
+
+The following example retrieves a list of restaurants (from a
+restaurants collection) whose name property contains the value "diner",
+sorting the list in ascending order by name:
+
+    /restaurants?ql=select * where name contains 'diner' order by name asc
+
+
+## Basic syntax
+
+Queries of Apigee data for Apache Usergrid are made up of two kinds of
+statements: the path to the collection you want to query, followed by
+the query language statement containing your query. These two statements
+are separated by "?ql=" to indicate where the query language statement
+starts.
+
+To retrieve items from a collection, you would use a syntax such as the
+following:
+
+    /<collection>?ql=<query_statement>
+
+In the following example, the query is retrieving all users whose name
+is Gladys Kravitz.
+
+    /users?ql=select * where name = 'Gladys Kravitz'
+
+The following example selects all items except those that have an a
+property value of 5:
+
+    /items?ql=select * where NOT a = 5
+
+Note that there is a shortcut available when your query selects all
+items matching certain criteria -- in other words, where you use a
+statement that starts "select \* where". In this case, you can omit the
+first part of the statement and abbreviate it this way:
+
+    /items?ql=NOT a = 5
+
+You query your Apache Usergrid data by using a query syntax that's like
+Structured Query Language (SQL), the query language for relational
+databases. Unlike a relational database, where you specify tables and
+columns containing the data you want to query, in your Apache Usergrid
+queries you specify collections and entities.
+
+The syntax of Apache Usergrid queries only *resembles* SQL to
+make queries familiar and easier to write. However, the language isn't
+SQL. Only the syntax items documented here are supported.
+
+## Supported operators
+
+Comparisons
+
+* Less than `<` or `lt`
+* Less than or equal `<=` or `lte`
+* Equal `=` or `eq`
+* Greater than or equal `>=` or `gte`
+* Greater than `>` or `gt`
+* Not equal `NOT`
+
+Logical operations
+
+* Intersection of results `and`
+* Union of results `or`
+* Subtraction of results `not`
+
+
+## Query Response Format
+
+the query’s response is formatted in
+JavaScript Object Notation (JSON). This is a common format used for
+parameter and return values in REST web services.
+
+So for the following query:
+
+    /users?ql=select * where name = ‘Gladys Kravitz’
+
+...you would get a response such as the the one below. The JSON format
+arranges the data in name/value pairs. Many of the values correspond to
+specifics of the request, including the request’s HTTP action (GET), the
+application’s UUID, the request’s parameters (the query string you
+sent), and so on.
+
+Here, the query is asking for whole entities in the users collection.
+Data corresponding to the response is captured in the response’s
+`entities` array. The array has one member here, corresponding to the
+one user found by the query (another kind of query might have found more
+users). That one member gives the UUID of the entity (user), the entity
+type, and values for properties such as name, username, email, and so
+on.
+
+```json
+{
+  "action" : "get",
+  "application" : "8272c9b0-d86a-11e2-92e2-cdf1ce04c1c0",
+  "params" : {
+    "ql" : [ "select * where name = 'Gladys Kravitz'" ]
+  },
+  "path" : "/users",
+  "uri" : "http://api.usergrid.com/myorg/myapp/users",
+  "entities" : [ {
+    "uuid" : "d0d7d0ba-e97b-11e2-8cef-411c466c4f2c",
+    "type" : "user",
+    "name" : "Gladys Kravitz",
+    "created" : 1373472876859,
+    "modified" : 1373472876859,
+    "username" : "gladys",
+    "email" : "gladys@example.com",
+    "activated" : true,
+    "picture" : "http://www.gravatar.com/avatar/20c57d4f41cf51f2db44165eb058b3b2",
+    "metadata" : {
+      "path" : "/users/d0d7d0ba-e97b-11e2-8cef-411c466c4f2c",
+      "sets" : {
+        "rolenames" : "/users/d0d7d0ba-e97b-11e2-8cef-411c466c4f2c/rolenames",
+        "permissions" : "/users/d0d7d0ba-e97b-11e2-8cef-411c466c4f2c/permissions"
+      },
+      "connections" : {
+        "firstname" : "/users/d0d7d0ba-e97b-11e2-8cef-411c466c4f2c/firstname",
+        "lastname" : "/users/d0d7d0ba-e97b-11e2-8cef-411c466c4f2c/lastname"
+      },
+      "collections" : {
+        "activities" : "/users/d0d7d0ba-e97b-11e2-8cef-411c466c4f2c/activities",
+        "devices" : "/users/d0d7d0ba-e97b-11e2-8cef-411c466c4f2c/devices",
+        "feed" : "/users/d0d7d0ba-e97b-11e2-8cef-411c466c4f2c/feed",
+        "groups" : "/users/d0d7d0ba-e97b-11e2-8cef-411c466c4f2c/groups",
+        "roles" : "/users/d0d7d0ba-e97b-11e2-8cef-411c466c4f2c/roles",
+        "following" : "/users/d0d7d0ba-e97b-11e2-8cef-411c466c4f2c/following",
+        "followers" : "/users/d0d7d0ba-e97b-11e2-8cef-411c466c4f2c/followers"
+      }
+    }
+  } ],
+  "timestamp" : 1374694196061,
+  "duration" : 48,
+  "organization" : "myorg",
+  "applicationName" : "myapp",
+  "count" : 1
+}
+```
+
+Compare the preceding example with the following for another kind of
+query. Imagine the following request string, where the query string is
+asking for only the values of two of the entity’s properties (username
+and name):
+
+    /users?ql=select username,name where name=’Gladys Kravitz’
+
+In the response JSON from this query, the return value is specified as
+the property of the `list` item -- here, an array containing only the
+values of the properties the query asked for, in the order they were
+requested (username first, then name).
+
+    {
+      "action" : "get",
+      "application" : "8272c9b0-d86a-11e2-92e2-cdf1ce04c1c0",
+      "params" : {
+        "ql" : [ "select username,name where name='Gladys Kravitz'" ]
+      },
+      "path" : "/users",
+      "uri" : "http://api.usergrid.com/myorg/myapp/users",
+      "list" : [ [ "gladys", "Gladys Kravitz" ] ],
+      "timestamp" : 1374697463190,
+      "duration" : 25,
+      "organization" : "myorg",
+      "applicationName" : "myapp",
+      "count" : 1
+    }
+
+
+## Data types supported in queries
+
+As you develop queries for your Apache Usergrid data, remember that entity
+properties each conform to a particular data type (whether the entity is
+included by default or an entity you defined). Your queries must
+acknowledge this, testing with values that conform to each property's
+data type. (You can view the list of property data types for the default
+entities at [Default Data Entities](/default-data-entities).)
+
+For example, in the default entity `User`, the `name` property is stored
+as a `string`, the created date as a `long`, and metadata is stored as a
+JSON object. Your queries must be data type-aware so that you can be
+sure that query results are as you expect them to be.
+
+So imagine you define an entity with a `price` property whose value
+might be `100.00`. Querying for `100` will return no results even if
+there are occurrences of `100.00` as `price` values in your data set.
+That's because the database expected a decimal-delimited `float` value
+in your query.
+
++-------------------------+-------------------------+-------------------------+
+| Data Type               | Examples                | Notes                   |
++=========================+=========================+=========================+
+| `string`                | `'value'`,              |                         |
+|                         | `unicode '\uFFFF'`,     |                         |
+|                         | `octal '\0707'`         |                         |
++-------------------------+-------------------------+-------------------------+
+| `long`                  |     1357412326021       | Timestamps are          |
+|                         |                         | typically stored as     |
+|                         |                         | `long` values.          |
++-------------------------+-------------------------+-------------------------+
+| `float`                 |     10.1, -10.1, 10e10, | Your query must be      |
+|                         |  10e-10, 10E10, 10E-10  | specific about the      |
+|                         |                         | value you're looking    |
+|                         |                         | for, down to the value  |
+|                         |                         | (if any) after the      |
+|                         |                         | decimal point.          |
++-------------------------+-------------------------+-------------------------+
+| `boolean`               |     true | false        |                         |
++-------------------------+-------------------------+-------------------------+
+| `UUID`                  |     ee912c4b-5769-11e2- | UUID types are          |
+|                         |     924d-02e81ac5a17b   | typically used for the  |
+|                         |                         | unique IDs of entities. |
+|                         |                         | The value must conform  |
+|                         |                         | to the following format |
+|                         |                         | (do not enclose with    |
+|                         |                         | quotation marks):       |
+|                         |                         |     xxxxxxxx-xxxx-xxxx- |
+|                         |                         | xxxx-xxxxxxxxxxxx       |
+|                         |                         |                         |
+|                         |                         | .                       |
++-------------------------+-------------------------+-------------------------+
+| `object`                | For a JSON object like  | Objects are often used  |
+|                         | this one:               | to contain entity       |
+|                         |                         | metadata, such as the   |
+|                         |     {                   | activities associated   |
+|                         |      "items": [         | with a user, the users  |
+|                         |       {                 | associated with a role, |
+|                         |        "name": "rocks"  | and so on.              |
+|                         |       },                |                         |
+|                         |       {                 |                         |
+|                         |        "name": "boats"  |                         |
+|                         |       }                 |                         |
+|                         |      ]                  |                         |
+|                         |     }                   |                         |
+|                         |                         |                         |
+|                         | ... you can use dot     |                         |
+|                         | notation to reach       |                         |
+|                         | property values in the  |                         |
+|                         | object:                 |                         |
+|                         |                         |                         |
+|                         |     /mycollection/thing |                         |
+|                         | ?ql="select * where ite |                         |
+|                         | ms.name = 'rocks'"      |                         |
++-------------------------+-------------------------+-------------------------+
+
+
+## Retrieving values for multiple properties
+
+Your query can return multiple kinds of values -- such as the values of
+multiple properties -- by specifying the property names in your select
+statement as a comma-separated list.
+
+For example, the following request returns the address and phone number
+of users whose name is Gladys Kravitz:
+
+    /users?ql=select address,phone_number where name = 'Gladys Kravitz'
+
+
+## Querying for the contents of text
+
+Your query can search the text of entity values of the string data type.
+For example, you can search a postal code field for values that start
+with a specific three numbers.
+
+For example, the following query selects all restaurants with the word
+`diner` in the name:
+
+    /restaurants?ql=select * where name contains 'diner'
+
+**Note:** Not all string properties of the default entities are
+indexed for searching. This includes the `User` entity's `username`
+property.
+
+This will return all users whose name property contains the word 'Kravitz'
+
+    /users?ql=select * where name contains 'Kravitz'
+
+This will return all users whose name property contains a word beginning with 'Krav'
+
+    /users?ql=select * where name contains 'Krav*'
+
+This will return all users whose name is exactly 'Gladys Kravitz'
+
+    /users?ql=select * where name = 'Gladys Kravitz'
+
+
+## Sorting results
+
+You can return query results that are sorted in the order you specify.
+Use the `order by` clause to specify the property to sort by, along with
+the order in which results should be sorted. The syntax for the clause
+is as follows `order by <property_name> asc | desc`
+
+The following table includes a few examples:
+
+    /users?ql=select * where lastname = 'Smith' order by firstname asc
+
+
+    /users?ql=select * where lastname = 'Smith' order by firstname desc
+
+
+    /users?ql=select * where lastname contains 'Sm*' order by lastname asc, firstname asc
+
+
+## Geoqueries
+
+Many of today's apps are enhanced by the use of *geolocation*, wireless
+detection of the physical location of a remote device. These apps are
+said to be *geolocation-aware* in that they query the device to
+determine the user's position and then use this data to further enhance
+the user's experience. For example, apps can capture the exact location
+where a picture was taken or a message was created.
+
+App services support geolocation on any entity, both built in (e.g.,
+users, groups) and user defined.
+
+To add a location to any entity, include the following member to the
+JSON in a POST or PUT call:
+
+    "location": {
+        "latitude": 37.779632,
+        "longitude": -122.395131  
+    } 
+
+For example, to store a listing of restaurants and their locations,
+start by creating a collection called restaurants:
+
+    POST https://api.usergrid.com/org_name/app_name/restaurants
+
+Next, add a new entity to the collection:
+
+    POST https://api.usergrid.com/org_name/app_name/restaurants
+    {
+      "name": "Rockadero",
+      "address": "21 Slate Street, Bedrock, CA",
+      "location": {
+        "latitude": 37.779632,
+        "longitude": -122.395131
+      }
+    }
+
+This creates a new restaurant entity called "Rockadero" with the
+longitude and latitude included as part of the object.
+
+When a location is added to an entity, it is easy to make queries
+against that data. For example, to see all restaurants within a 10 mile
+radius of the user's location, make a GET call against that entity, and
+include a search query in the following format:
+
+    location within <distance in meters> of <latitude>, <longitude>
+
+If we use the location of our user Fred, we first need to convert miles
+to meters. 1 mile is equivalent to 1609.344 meters, so 10 miles is about
+16093 meters. Thus, the API call looks like this:
+
+    GET https://api.usergrid.com/org_name/app_name/restaurants?ql=location within 16093 of 37.776753, -122.407846
+
+
+## Managing large sets of results
+
+When your query might return more results than you want to display to
+the user at once, you can use the limit parameter with cursors or API
+methods to manage the display of results. By default, query results are
+limited to 10 at a time. You can adjust this by setting the limit
+parameter to a value you prefer.
+
+For example, you might execute a query that could potentially return
+hundreds of results, but you want to display 20 of those at a time to
+users. To do this, your code sets the limit parameter to 20 when
+querying for data, then provides a way for the user to request more of
+the results when they're ready.
+
+You would use the following parameters in your query:
+
++-------------------------+-------------------------+-------------------------+
+| Parameter               | Type                    | Description             |
++=========================+=========================+=========================+
+| `limit`                 | integer                 | Number of results to    |
+|                         |                         | return. The maximum     |
+|                         |                         | number of results is    |
+|                         |                         | 1,000. Specifying a     |
+|                         |                         | limit greater than      |
+|                         |                         | 1,000 will result in a  |
+|                         |                         | limit of 1,000.         |
+|                         |                         |                         |
+|                         |                         | Limit is applied to the |
+|                         |                         | collection, not the     |
+|                         |                         | query string. For       |
+|                         |                         | example, the following  |
+|                         |                         | query will find the     |
+|                         |                         | first 100 entities in   |
+|                         |                         | the books collection,   |
+|                         |                         | then from that set      |
+|                         |                         | return the ones with    |
+|                         |                         | author='Hemingway':     |
+|                         |                         |                         |
+|                         |                         |     /books?ql=author =  |
+|                         |                         | 'Hemingway'&limit=100   |
+|                         |                         |                         |
+|                         |                         | You can also use the    |
+|                         |                         | limit parameter on a    |
+|                         |                         | request without a query |
+|                         |                         | string. The following   |
+|                         |                         | example is shorthand    |
+|                         |                         | for selecting all books |
+|                         |                         | and limiting by 100 at  |
+|                         |                         | a time:                 |
+|                         |                         |                         |
+|                         |                         |     /books?limit=100    |
+|                         |                         |                         |
+|                         |                         | Using a limit on a      |
+|                         |                         | DELETE can help you     |
+|                         |                         | manage the amount of    |
+|                         |                         | time it takes to delete |
+|                         |                         | data. For example you   |
+|                         |                         | can delete all of the   |
+|                         |                         | books, 1000 at a time,  |
+|                         |                         | with the following:     |
+|                         |                         |                         |
+|                         |                         |     DELETE /books?limit |
+|                         |                         | =1000                   |
+|                         |                         |                         |
+|                         |                         | Keep in mind that       |
+|                         |                         | DELETE operations can   |
+|                         |                         | take longer to execute. |
+|                         |                         | Yet even though the     |
+|                         |                         | DELETE query call might |
+|                         |                         | time out (such as with  |
+|                         |                         | a very large limit),    |
+|                         |                         | the operation will      |
+|                         |                         | continue on the server  |
+|                         |                         | even if the client      |
+|                         |                         | stops waiting for the   |
+|                         |                         | result.                 |
++-------------------------+-------------------------+-------------------------+
+| `cursor`                | string                  | An encoded              |
+|                         |                         | representation of the   |
+|                         |                         | query position pointing |
+|                         |                         | to a set of results. To |
+|                         |                         | retrieve the next set   |
+|                         |                         | of results, pass the    |
+|                         |                         | cursor with your next   |
+|                         |                         | call for most results.  |
++-------------------------+-------------------------+-------------------------+
+
+For example:
+
+Select all users whose name starts with fred, and returns the first 50
+results:
+
+    /users?ql=select * where name = 'fred*'&limit=50
+
+Retrieve the next batch of users whose name is "fred", passing the
+cursor received from the last request to specify where the next set of
+results should begin:
+
+    /users?ql=select * where name = 'fred*'&limit=50&cursor=LTIxNDg0NDUxNDpnR2tBQVFFQWdITUFDWFJ2YlM1emJXbDBhQUNBZFFBUUQyMVZneExfRWVLRlV3TG9Hc1doZXdDQWRRQVFIYVdjb0JwREVlS1VCd0xvR3NWT0JRQQ

Added: incubator/usergrid/site/content/docs/relationships.md
URL: http://svn.apache.org/viewvc/incubator/usergrid/site/content/docs/relationships.md?rev=1552550&view=auto
==============================================================================
--- incubator/usergrid/site/content/docs/relationships.md (added)
+++ incubator/usergrid/site/content/docs/relationships.md Fri Dec 20 09:15:11 2013
@@ -0,0 +1,104 @@
+---
+title: Relationships
+category: docs
+layout: docs
+---
+
+Creating connections between entities
+-------------------------------------
+
+One of the most useful features of App services is the ability to create
+connections between entities. A simple example of this is the
+Twitter-like use of *following*, where one user forms a connection with
+another by subscribing to any tweets they post. [Messagee
+Example](/messagee-example) walks you through an example of following
+other users in our sample app, *Messagee*. Here is the basic format:
+
+    POST https://api.usergrid.com/my-org/my-app/users/fred/following/users/barney
+
+This API call results in two users, Fred and Barney, linked with a
+connection where Fred is following Barney.
+
+If you create a *following* connection between two users, Apache Usergrid
+automatically creates a virtual connection called *followers* that
+mirrors the *following* connection. In other words, if you create a
+connection where Fred is following Barney, Apache Usergrid automatically
+creates a virtual connection where Fred is a follower of Barney.
+
+Note that there is no mirror connection established. Apache Usergrid only
+creates a mirror connection when you create a *following* connection. It
+does not create a mirror connection for other verbs such as likes.
+
+You can see all the users that Fred is following, in this case only
+Barney, by making the following API call:
+
+    GET https://api.usergrid.com/my-org/my-app/users/fred/following
+
+You can see all of barney’s followers, in this case only Fred, by making
+the following API call:
+
+    GET https://api.usergrid.com/my-org/my-app/users/barney/followers
+
+The *followers* connection is a virtual connection because you can’t use
+it to link two entities. In other words, you can’t make fred a follower
+of barney by using a *followers* connection.  **This is wrong:**
+
+    POST https://api.usergrid.com/my-org/my-app/users/barney/followers/users/fred
+
+To create a *following* connection with the users switched, so that
+Barney is following Fred, do this:
+
+    POST https://api.usergrid.com/my-org/my-app/users/barney/following/users/fred
+
+You can now see Fred’s followers (only Barney) by making the following
+call:
+
+    GET https://api.usergrid.com/my-org/my-app/users/fred/followers
+
+Creating other connections
+--------------------------
+
+You can extend this connection structure to create connections using any
+"verb" that can link two entities. For example, you could use likes to
+denote a connection between a user and his dog. First, create a dogs
+collection:
+
+    POST https://api.usergrid.com/my-org/my-app/dogs
+
+Then populate this collection with a new dog named Dino:
+
+    POST https://api.usergrid.com/my-org/my-app/dogs {"name" : "dino"}
+
+Then create a likes connection between Fred and his dog Dino:
+
+    POST https://api.usergrid.com/my-org/my-app/users/fred/likes/dogs/dino
+
+Getting connections
+-------------------
+
+### Get all connections for an entity
+
+To get a list that only contains the connections, do a GET on the
+connections sub-property of the entity:
+
+    GET https://api.usergrid.com/my-org/my-app/users/fred/connections
+
+### Get information on a specific connection type
+
+To get a list of users who like Fred:
+
+    GET https://api.usergrid.com/my-org/my-app/users/fred/connecting/likes
+
+To get a list of all dogs that Fred likes:
+
+    GET https://api.usergrid.com/my-org/my-app/users/fred/likes/dog
+
+Deleting a connection
+---------------------
+
+You can delete a connection in a way similar to creating one. Just
+replace the POST method with the DELETE method. For example, you can
+delete the connection between fred and barney with the following API
+call:
+
+    DELETE https://api.usergrid.com/my-org/my-app/users/fred/following/barney