See all application entities

You can create a new application in an organization through the Admin portal. The Admin portal creates the new application by issuing a post against the management endpoint (see the "Creating an organization application" section in Organization for details). If you need to create an application programmatically in your app, you can also use the API to do this. You can access application entities using your app name or UUID, prefixed with the organization name or UUID:

https://api.usergrid.com/{org_name|uuid}/{app_name|uuid}

Most mobile apps never access the application entity directly. For example you might have a server-side web app that accesses the application entity for configuration purposes. If you want to access your application entity programmatically, you can use the API.

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 -X -i POST "https://api.usergrid.com/management/orgs/testorg/apps?access_token=YWMtmNIFFBI6EeKvXSIACowF7QAAATpL0bVQtGOWe8PMwLfQ9kD_VKQa7IH4UBQ" -d '{"name":"testapp1"}'

It is recommended that you use the Admin Portal 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.

 

The example assumes use of the Ruby SDK.

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.

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
}

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 for details.

 

Example - Request

curl -X POST "https://api.usergrid.com/management/orgs/testorg/apps/testapp1/credentials"

It is recommended that you use the Admin Portal 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.

The example assumes use of the Ruby SDK.

mgmt = Usergrid::Management.new 'https://api.usergrid.com/'
mgmt['orgs/testorg/apps/testapp1/credentials'].create

The example assumes use of the Node.js module.

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 for details.

 

Example - Request

curl -X GET "https://api.usergrid.com/management/orgs/testorg/apps/testapp1/credentials"

It is recommended that you use the Admin Portal 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.

The example assumes use of the Ruby SDK.

mgmt = Usergrid::Management.new 'https://api.usergrid.com/'
mgmt['orgs/testorg/apps/testapp1/credentials']

The example assumes use of the Node.js 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"
  }
}

Help or comments?

  • Something's not working: See Apigee Support
  • Something's wrong with the docs: Click Send Feedback in the lower right.
    (Incorrect? Unclear? Broken link? Typo?)