Applications
Summary
The Applications REST API provides application management to the API Manager's client registry
Description
With the Applications API, it is possible to create, delete, and manage applications in the Portal
Resources
GET /api/portal/v1.2/applications
Summary
Get the list of applications
Description
Get the list of applications that are visible to the authenticated user. The list of applications can be filtered using the expression: field=__field__&op=__op__&value=__value__. Optionally, you can add a logical operation for all expressions, using the form: &lop=AND|OR. By default, the logical operation is AND. Multiple expression filters can be used, specifying field, op, and value for each filter. The field is one of:
- apiid
- Matches the application if the application is using the API, specified by ID
- userid
- Matches the application if the user has explicit access to the application, specified by ID
- description
- The application's description
- The application's contact email address
- enabled
- The enabled state of the application, one of: enabled, disabled
- createdOn
- The date the application was created on, time in ms, e.g.: 1372755998542
- name
- The name of the application
- orgid
- Matches the application if the application is part of the organization, specified by ID
- phone
- The application's contact phone
- state
- The application's current state, one of: approved, pending
The op is an operation and is one of:
- eq
- Equal
- ne
- Not equal
- gt
- Greater than
- lt
- Less than
- ge
- Greater than or equal
- le
- Less than or equal
- like
- Like
- gete
- Greater than or equal to, and less than or equal to; the value should be a lower-minimum and upper-maximum separated by comma, e.g: value=5,10
The value will be compared against the field, according to the supplied op.
Parameters
| Parameter | Description | Data Type | Location | Required | Multiple |
|---|---|---|---|---|---|
field |
Filter field name. | String | query | Multiple | |
op |
Filter operation. | String | query | Multiple | |
value |
Filter value | String / Integer | query | Multiple |
Status Codes
| HTTP Status Code | Reason |
|---|---|
| 200 | OK |
| 400 | Bad Request |
| 500 | Internal Server Error |
Returns Array
[ Application ]
Example
GET https://localhost:8075/api/portal/v1.2/applications?field=name&op=eq&value=My%20First%20iPhone%20App&field=enabled&op=eq&value=disabled
ResponseHTTP 1.1 200 OK
[ {
"id" : "b76a3e23-deca-49ab-9682-79cd503b7e3a",
"name" : "My First iPhone App",
"description" : "My First iPhone App which is a \"Hello World\" basic application",
"organizationId" : "3e21b76a-defa-49ab-9682-a9cd60387e37",
"phone" : "+1 877-564-7700",
"email" : "support@acmecorp.com",
"createdBy" : "de077cd8-83b7-46d1-b06f-2eaaf1548898",
"managedBy" : [ "de077cd8-83b7-46d1-b06f-2eaaf1548898" ],
"createdOn" : 1364407145121,
"enabled" : false,
"image" : "resources/photo.jpg",
"state" : "approved"
} ]
POST /api/portal/v1.2/applications
Summary
Creates a new application.
Description
Creates a new application. New applications may need to be approved using /approve.
Parameters
| Parameter | Description | Data Type | Location | Required | Multiple |
|---|---|---|---|---|---|
- |
API Manager application request. | ApplicationRequest | body | Required |
Status Codes
| HTTP Status Code | Reason |
|---|---|
| 201 | Created |
| 400 | Bad Request |
| 403 | Forbidden |
| 500 | Internal Server Error |
Returns Class
Example
POST https://localhost:8075/api/portal/v1.2/applications
Request
{"name" : "My iPhone App","description" : "Acme Corporation iPhone App","email" : "support@acmecorp.com","phone" : "+1 877-564-7700","apis":["925129c4-0c4b-4adb-95c4-fdbc741eb333"],"organizationId" : "f7842fdc-ab83-4bca-82c9-7eac76eeef99"}Response
HTTP 1.1 201 Created{
"id" : "b76a3e23-deca-49ab-9682-79cd503b7e3a",
"name" : "My First iPhone App",
"description" : "My First iPhone App which is a \"Hello World\" basic application",
"organizationId" : "3e21b76a-defa-49ab-9682-a9cd60387e37",
"phone" : "+1 877-564-7700",
"email" : "support@acmecorp.com",
"createdBy" : "de077cd8-83b7-46d1-b06f-2eaaf1548898",
"managedBy" : [ "de077cd8-83b7-46d1-b06f-2eaaf1548898" ],
"createdOn" : 1364407145121,
"enabled" : false,
"image" : "resources/photo.jpg",
"state" : "approved"
}
GET /api/portal/v1.2/applications/oauthclient/{clientId}
Summary
Get an application associated with an OAuth Client ID
Description
Retrieves the application associated with an OAuth Client ID
Parameters
| Parameter | Description | Data Type | Location | Required | Multiple |
|---|---|---|---|---|---|
clientId |
The OAuth Client ID associated with the Application. | String | path | Required |
Status Codes
| HTTP Status Code | Reason |
|---|---|
| 200 | OK |
| 404 | Not Found |
| 500 | Internal Server Error |
Returns Class
DELETE /api/portal/v1.2/applications/{id}
Summary
Delete an application
Description
Only managers of the application, API Manager Administrators, or Organization Administrators with enabled delegated application management privileges, may delete applications.
Parameters
| Parameter | Description | Data Type | Location | Required | Multiple |
|---|---|---|---|---|---|
id |
The ID of application to delete. | String | path | Required |
Status Codes
| HTTP Status Code | Reason |
|---|---|
| 204 | No Content |
| 404 | Not Found |
| 500 | Internal Server Error |
GET /api/portal/v1.2/applications/{id}
Summary
Get an application
Description
Retrieves the details of an application.
Parameters
| Parameter | Description | Data Type | Location | Required | Multiple |
|---|---|---|---|---|---|
id |
The ID of the application to be returned. | String | path | Required |
Status Codes
| HTTP Status Code | Reason |
|---|---|
| 200 | OK |
| 204 | No Content |
| 404 | Not Found |
| 500 | Internal Server Error |
Returns Class
PUT /api/portal/v1.2/applications/{id}
Summary
Update an application
Description
Only managers of the application, API Manager Administrators, or Organization Administrators with enabled delegated application management privileges, may update an application. Note, if a field is omitted from the payload, or its value is set to null, the existing value for this field will be retained.
Parameters
| Parameter | Description | Data Type | Location | Required | Multiple |
|---|---|---|---|---|---|
id |
The ID of the application to be updated | String | path | Required | |
- |
API Manager application. | Application | body | Required |
Status Codes
| HTTP Status Code | Reason |
|---|---|
| 200 | OK |
| 404 | Not Found |
| 400 | Bad Request |
| 500 | Internal Server Error |
Returns Class
Example
PUT https://localhost:8075/api/portal/v1.2/applications/{id}
Request
{"name" : "My iPhone App","description" : "Acme Corporation iPhone App"}Response
HTTP 1.1 200 OK{
"id" : "b76a3e23-deca-49ab-9682-79cd503b7e3a",
"name" : "My First iPhone App",
"description" : "My First iPhone App which is a \"Hello World\" basic application",
"organizationId" : "3e21b76a-defa-49ab-9682-a9cd60387e37",
"phone" : "+1 877-564-7700",
"email" : "support@acmecorp.com",
"createdBy" : "de077cd8-83b7-46d1-b06f-2eaaf1548898",
"managedBy" : [ "de077cd8-83b7-46d1-b06f-2eaaf1548898" ],
"createdOn" : 1364407145121,
"enabled" : false,
"image" : "resources/photo.jpg",
"state" : "approved"
}
POST /api/portal/v1.2/applications/{id}/apikeys
Summary
Creates a new API Key and secret for the application
Description
Creates a new API Key and secret for the application.
Parameters
| Parameter | Description | Data Type | Location | Required | Multiple |
|---|---|---|---|---|---|
id |
The ID of application requiring an API Key. | String | path | Required |
Status Codes
| HTTP Status Code | Reason |
|---|---|
| 201 | Created |
| 204 | No Content |
| 404 | Not Found |
| 500 | Internal Server Error |
Returns Class
Example
POST https://localhost:8075/api/portal/v1.2/applications/{id}/apikeys
ResponseHTTP 1.1 201 Created
{
"id" : "19da5d5e-b18a-4217-abec-291033cd939c",
"secret" : "19da5d5e-b18a-4217-abec-291033cd939c",
"enabled" : true,
"createdBy" : "3e21b76a-defa-49ab-9682-a9cd60387e37",
"createdOn" : 1364287486876,
"deletedOn" : 1364287486876,
"corsOrigins" : [ "example.com" ]
}
GET /api/portal/v1.2/applications/{id}/apikeys
Summary
Returns the API Keys associated with an application
Description
Returns the API Keys associated with an application.
Parameters
| Parameter | Description | Data Type | Location | Required | Multiple |
|---|---|---|---|---|---|
id |
The ID of application whose API Keys are to be returned. | String | path | Required |
Status Codes
| HTTP Status Code | Reason |
|---|---|
| 200 | OK |
| 204 | No Content |
| 404 | Not Found |
| 500 | Internal Server Error |
Returns Array
[ APIKey ]
PUT /api/portal/v1.2/applications/{id}/apikeys/{apikeyid}
Summary
Updates an API Key
Description
Updates an API Key and secret for the application. The fields id, createdBy, createdOn are read only.
Parameters
| Parameter | Description | Data Type | Location | Required | Multiple |
|---|---|---|---|---|---|
id |
The ID of application whose API Key is to be updated. | String | path | Required | |
apikeyid |
The ID of the API Key to be updated. | String | path | Required | |
- |
API Manager API Key for use in authenticating applications | APIKey | body | Required |
Status Codes
| HTTP Status Code | Reason |
|---|---|
| 204 | No Content |
| 404 | Not Found |
| 500 | Internal Server Error |
Returns Class
Example
PUT https://localhost:8075/api/portal/v1.2/applications/{id}/apikeys/{apikeyid}
Request
{"id": "19da5d5e-b18a-4217-abec-291033cd939c", "createdBy": "b03f88d2-411d-46aa-9245-21be1748011f", "createdOn": 1364977239741, "enabled": false, "deletedOn": null, "secret": "d438f70f-990e-480c-ad1a-baae2d07a326"}Response
HTTP 1.1 201 Created{
"id" : "19da5d5e-b18a-4217-abec-291033cd939c",
"secret" : "19da5d5e-b18a-4217-abec-291033cd939c",
"enabled" : true,
"createdBy" : "3e21b76a-defa-49ab-9682-a9cd60387e37",
"createdOn" : 1364287486876,
"deletedOn" : 1364287486876,
"corsOrigins" : [ "example.com" ]
}
DELETE /api/portal/v1.2/applications/{id}/apikeys/{keyId}
Summary
Delete an API Key
Description
Deletes an API Key. Deleting an API key means that it will no longer be accepted for application authentication.
Parameters
| Parameter | Description | Data Type | Location | Required | Multiple |
|---|---|---|---|---|---|
id |
The API Key ID to be deleted. | String | path | Required | |
keyId |
String | path | Required | ||
applicationId |
The ID of application whose API Key is to be deleted. | query | Required |
Status Codes
| HTTP Status Code | Reason |
|---|---|
| 204 | No Content |
| 404 | Not Found |
| 500 | Internal Server Error |
POST /api/portal/v1.2/applications/{id}/apis
Summary
Create a request for an application to access an API.
Description
Only API Manager Administrator, or an Organization Administrator of the application's organization with the correct privileges, or the application manager may create API access requests.
Parameters
| Parameter | Description | Data Type | Location | Required | Multiple |
|---|---|---|---|---|---|
id |
The application ID. | String | path | Required | |
- |
API Access indicates whether access to an API is available | APIAccess | body | Required |
Status Codes
| HTTP Status Code | Reason |
|---|---|
| 201 | Created |
| 204 | No Content |
| 400 | Bad Request |
| 500 | Internal Server Error |
Returns Class
Example
POST https://localhost:8075/api/portal/v1.2/applications/{id}/apis
Request
{"apiId" : "e41f217e-d19f-4ee7-b845-fff017cfa098"}Response
HTTP 1.1 201 Created{
"id" : "19da5d5e-b18a-4217-abec-291033cd939c",
"apiId" : "c1c63d3b-5283-4755-ade7-e2377bd35049",
"createdBy" : "3e21b76a-defa-49ab-9682-a9cd60387e37",
"state" : "approved",
"createdOn" : 1364287486876,
"enabled" : true
}
GET /api/portal/v1.2/applications/{id}/apis
Summary
Get the list of APIs that the application can access
Description
Get the list of APIs that the application can access.
Parameters
| Parameter | Description | Data Type | Location | Required | Multiple |
|---|---|---|---|---|---|
id |
The application ID. | String | path | Required |
Status Codes
| HTTP Status Code | Reason |
|---|---|
| 200 | OK |
| 403 | Forbidden |
| 404 | Not Found |
| 500 | Internal Server Error |
Returns Array
[ APIAccess ]
PUT /api/portal/v1.2/applications/{id}/apis/{apiAccessId}
Summary
Updates access to an API for an application
Description
Updates access to an API for an application. Only enabled may be modified.
Parameters
| Parameter | Description | Data Type | Location | Required | Multiple |
|---|---|---|---|---|---|
id |
The application ID. | String | path | Required | |
apiAccessId |
The API access ID. | String | path | Required | |
- |
API Access indicates whether access to an API is available | APIAccess | body | Required |
Status Codes
| HTTP Status Code | Reason |
|---|---|
| 200 | OK |
| 404 | Not Found |
| 403 | Forbidden |
| 500 | Internal Server Error |
Returns Class
Example
PUT https://localhost:8075/api/portal/v1.2/applications/{id}/apis/{apiAccessId}
Request
{"id" : "ecc2f2c5-1aa8-43e4-baf6-6a2158c44121","apiId" : "3a83e303-2bd5-49a4-b37c-f4a89979846f","createdBy" : "de077cd8-83b7-46d1-b06f-2eaaf1548898","state" : "approved","createdOn" : 1364403372805,"enabled" : false}Response
HTTP 1.1 201 Created{
"id" : "19da5d5e-b18a-4217-abec-291033cd939c",
"apiId" : "c1c63d3b-5283-4755-ade7-e2377bd35049",
"createdBy" : "3e21b76a-defa-49ab-9682-a9cd60387e37",
"state" : "approved",
"createdOn" : 1364287486876,
"enabled" : true
}
DELETE /api/portal/v1.2/applications/{id}/apis/{apiAccessId}
Summary
Deletes access to an API for an application
Description
Permanently deletes access to an API for an application.
Parameters
| Parameter | Description | Data Type | Location | Required | Multiple |
|---|---|---|---|---|---|
id |
The application ID. | String | path | Required | |
apiAccessId |
The API access ID. | String | path | Required |
Status Codes
| HTTP Status Code | Reason |
|---|---|
| 404 | Not Found |
| 204 | No Content |
| 403 | Forbidden |
| 500 | Internal Server Error |
Returns Class
Example
DELETE https://localhost:8075/api/portal/v1.2/applications/{id}/apis/{apiAccessId}
Request
{"id" : "ecc2f2c5-1aa8-43e4-baf6-6a2158c44121","apiId" : "3a83e303-2bd5-49a4-b37c-f4a89979846f","createdBy" : "de077cd8-83b7-46d1-b06f-2eaaf1548898","state" : "approved","createdOn" : 1364403372805,"enabled" : false}Response
HTTP 1.1 201 Created{
"id" : "19da5d5e-b18a-4217-abec-291033cd939c",
"apiId" : "c1c63d3b-5283-4755-ade7-e2377bd35049",
"createdBy" : "3e21b76a-defa-49ab-9682-a9cd60387e37",
"state" : "approved",
"createdOn" : 1364287486876,
"enabled" : true
}
POST /api/portal/v1.2/applications/{id}/apis/{apiAccessId}/approve
Summary
Creates an API access request to an API for an application.
Description
Approving user must be API Manager Administrator or an Organization Administrator of the application's organization with the correct privileges to approve API access requests.
Parameters
| Parameter | Description | Data Type | Location | Required | Multiple |
|---|---|---|---|---|---|
id |
The application ID. | String | path | Required | |
apiAccessId |
The API access ID. | String | path | Required |
Status Codes
| HTTP Status Code | Reason |
|---|---|
| 201 | Created |
| 400 | Bad Request |
| 403 | Forbidden |
| 500 | Internal Server Error |
POST /api/portal/v1.2/applications/{id}/approve
Summary
Approves a pending application request
Description
Approving user must be API Manager Administrator or an Organization Administrator of the application's organization with the correct privileges to approve new application requests.
Parameters
| Parameter | Description | Data Type | Location | Required | Multiple |
|---|---|---|---|---|---|
id |
The application request ID. | String | path | Required |
Status Codes
| HTTP Status Code | Reason |
|---|---|
| 201 | Created |
| 400 | Bad Request |
| 404 | Not Found |
| 500 | Internal Server Error |
GET /api/portal/v1.2/applications/{id}/availablescopes
Summary
Returns the scopes available to an application
Description
Returns the OAuth scopes available to an application.
Parameters
| Parameter | Description | Data Type | Location | Required | Multiple |
|---|---|---|---|---|---|
id |
The ID of application whose OAuth scopes are to be returned. | String | path | Required |
Status Codes
| HTTP Status Code | Reason |
|---|---|
| 204 | No Content |
| 404 | Not Found |
| 500 | Internal Server Error |
Returns Array
[ Set ]
GET /api/portal/v1.2/applications/{id}/extclients
Summary
Returns the external clients associated with an application
Description
Returns the external clients associated with an application. External clients are used when authenticating the application through a 3rd party OAuth service
Parameters
| Parameter | Description | Data Type | Location | Required | Multiple |
|---|---|---|---|---|---|
id |
The ID of application whose external clients are to be returned. | String | path | Required |
Status Codes
| HTTP Status Code | Reason |
|---|---|
| 200 | OK |
| 400 | Bad Request |
| 500 | Internal Server Error |
Returns Array
[ ExternalClient ]
POST /api/portal/v1.2/applications/{id}/extclients
Summary
Maps a new external client to the application
Description
Maps a new external client to the application. External clients are used when authenticating the application through a 3rd party OAuth service
Parameters
| Parameter | Description | Data Type | Location | Required | Multiple |
|---|---|---|---|---|---|
id |
The ID of application to map to an external client. | String | path | Required | |
- |
API Manager external client | ExternalClient | body | Required |
Status Codes
| HTTP Status Code | Reason |
|---|---|
| 201 | Created |
| 400 | Bad Request |
| 500 | Internal Server Error |
Returns Class
Example
POST https://localhost:8075/api/portal/v1.2/applications/{id}/extclients
Request
{"clientId" : "296ec1ae-3fc7-4470-8d90-a6cc1482797f", "corsOrigins" : [ "example.com" ], "enabled" : true}Response
HTTP 1.1 201 Created{
"id" : "19da5d5e-b18a-4217-abec-291033cd939c",
"clientId" : "296ec1ae-3fc7-4470-8d90-a6cc1482797f",
"enabled" : true,
"createdBy" : "3e21b76a-defa-49ab-9682-a9cd60387e37",
"createdOn" : 1364287486876,
"corsOrigins" : [ "example.com" ]
}
PUT /api/portal/v1.2/applications/{id}/extclients/{objectId}
Summary
Updates an external client for the application
Description
Updates an external client for the application. External clients are used when authenticating the application through a 3rd party OAuth service
Parameters
| Parameter | Description | Data Type | Location | Required | Multiple |
|---|---|---|---|---|---|
id |
The ID of application whose external client is to be updated. | String | path | Required | |
objectId |
The external client entry to be updated. | String | path | Required | |
- |
API Manager external client | ExternalClient | body | Required |
Status Codes
| HTTP Status Code | Reason |
|---|---|
| 200 | OK |
| 400 | Bad Request |
| 500 | Internal Server Error |
Returns Class
Example
PUT https://localhost:8075/api/portal/v1.2/applications/{id}/extclients/{objectId}
Request
{"id": "19da5d5e-b18a-4217-abec-291033cd939c", "clientId": "296ec1ae-3fc7-4470-8d90-a6cc1482797f", "corsOrigins" : [ "example.com" ], "enabled": false, "createdBy": "b03f88d2-411d-46aa-9245-21be1748011f", "createdOn": 1364977239741}Response
HTTP 1.1 200 OK{
"id" : "19da5d5e-b18a-4217-abec-291033cd939c",
"clientId" : "296ec1ae-3fc7-4470-8d90-a6cc1482797f",
"enabled" : true,
"createdBy" : "3e21b76a-defa-49ab-9682-a9cd60387e37",
"createdOn" : 1364287486876,
"corsOrigins" : [ "example.com" ]
}
DELETE /api/portal/v1.2/applications/{id}/extclients/{objectId}
Summary
Delete an external client
Description
Deletes an external client. Deleting a mapping means that it will no longer be accepted for application authentication.
Parameters
| Parameter | Description | Data Type | Location | Required | Multiple |
|---|---|---|---|---|---|
id |
The ID of application whose external client is to be deleted. | String | path | Required | |
objectId |
The ID of the external client entry to be deleted. | String | path | Required |
Status Codes
| HTTP Status Code | Reason |
|---|---|
| 204 | No Content |
| 400 | Bad Request |
| 500 | Internal Server Error |
GET /api/portal/v1.2/applications/{id}/image/
Summary
Get the image for an application
Description
Get the JPEG image associated with an application.
Parameters
| Parameter | Description | Data Type | Location | Required | Multiple |
|---|---|---|---|---|---|
id |
The ID of the application whose image is to be return | String | path | Required |
Status Codes
| HTTP Status Code | Reason |
|---|---|
| 204 | No Content |
| 404 | Not Found |
| 500 | Internal Server Error |
POST /api/portal/v1.2/applications/{id}/image/
Summary
Adds a JPEG image to an application
Description
Adds a JPEG image to an application with a MultiPart POST
Parameters
| Parameter | Description | Data Type | Location | Required | Multiple |
|---|---|---|---|---|---|
id |
The ID of the application whose image is being added | String | path | Required | |
file |
The file uploaded in the POST body as an element in a multipart post | File | form | Required | |
type |
String | query |
Status Codes
| HTTP Status Code | Reason |
|---|---|
| 200 | OK |
| 400 | Bad Request |
| 404 | Not Found |
| 409 | Conflict |
| 413 | Request Entity Too Large |
| 500 | Internal Server Error |
POST /api/portal/v1.2/applications/{id}/oauth
Summary
Creates a new OAuth client ID and secret for the application
Description
Creates a new OAuth client ID and secret for the application.
Parameters
| Parameter | Description | Data Type | Location | Required | Multiple |
|---|---|---|---|---|---|
id |
The ID of application requiring an OAuth client ID and secret. | String | path | Required | |
- |
The OAuth credential to create | OAuthClient | body | Required |
Status Codes
| HTTP Status Code | Reason |
|---|---|
| 201 | Created |
| 204 | No Content |
| 404 | Not Found |
| 500 | Internal Server Error |
Returns Class
Example
POST https://localhost:8075/api/portal/v1.2/applications/{id}/oauth
Request
{"applicationId":"c95b7c70-fe01-4e31-8f1f-cdd977812d7d","enabled":true,"secret":"","type":"public","redirectUrls":["qwerty"],"cert":"-----BEGIN CERTIFICATE----- MIIDp...9b+Ng== -----END CERTIFICATE-----"}Response
HTTP 1.1 201 Created{
"id" : "7b32f6c9-9e27-4def-87e2-247aadf7f583",
"cert" : "-----BEGIN CERTIFICATE-----MIICUTC..............-----END CERTIFICATE-----",
"secret" : "ddf27559-ace0-4c4f-b5e4-ecf2086fddc5",
"type" : "public",
"enabled" : true,
"redirectUrls" : [ "https://example.com/callback" ],
"corsOrigins" : [ "example.com" ],
"createdBy" : "3e21b76a-defa-49ab-9682-a9cd60387e37",
"createdOn" : 1364287486876,
"applicationId" : null
}
GET /api/portal/v1.2/applications/{id}/oauth
Summary
Returns the OAuth Credentials associated with an application
Description
Returns the OAuth Credentials associated with an application.
Parameters
| Parameter | Description | Data Type | Location | Required | Multiple |
|---|---|---|---|---|---|
id |
The ID of application whose OAuth Credentials are to be returned. | String | path | Required |
Status Codes
| HTTP Status Code | Reason |
|---|---|
| 200 | OK |
| 204 | No Content |
| 404 | Not Found |
| 500 | Internal Server Error |
Returns Array
[ OAuthClient ]
PUT /api/portal/v1.2/applications/{id}/oauth/{clientId}
Summary
Updates an OAuth Credential for the application
Description
Updates an OAuth Credential for the application.
Parameters
| Parameter | Description | Data Type | Location | Required | Multiple |
|---|---|---|---|---|---|
id |
The ID of application whose OAuth credential is to be updated. | String | path | Required | |
clientId |
The OAuth Credential ID to be updated. | String | path | Required | |
- |
API Manager OAuth Credentials. | OAuthClient | body | Required |
Status Codes
| HTTP Status Code | Reason |
|---|---|
| 204 | No Content |
| 404 | Not Found |
| 500 | Internal Server Error |
Returns Class
Example
PUT https://localhost:8075/api/portal/v1.2/applications/{id}/oauth/{clientId}
Request
{"id":"SamplePublicApp","cert":"-----BEGIN CERTIFICATE----- ... -----END CERTIFICATE-----","secret":"3b001542-e348-443b-9ca2-2f38bd3f3e84","type":"public","enabled":true,"redirectUrls":["https://localhost/oauth_callback2"],"createdBy":null,"createdOn":1370438809017,"applicationId":"05d2d25e-d037-4742-a1fb-eea5480ec18c"}Response
HTTP 1.1 200 OK{
"id" : "7b32f6c9-9e27-4def-87e2-247aadf7f583",
"cert" : "-----BEGIN CERTIFICATE-----MIICUTC..............-----END CERTIFICATE-----",
"secret" : "ddf27559-ace0-4c4f-b5e4-ecf2086fddc5",
"type" : "public",
"enabled" : true,
"redirectUrls" : [ "https://example.com/callback" ],
"corsOrigins" : [ "example.com" ],
"createdBy" : "3e21b76a-defa-49ab-9682-a9cd60387e37",
"createdOn" : 1364287486876,
"applicationId" : null
}
PUT /api/portal/v1.2/applications/{id}/oauth/{clientid}/newsecret
Summary
Updates an OAuth Credential for an application by generating a new secret
Description
Updates an OAuth Credential for an application by generating a new client secret.
Parameters
| Parameter | Description | Data Type | Location | Required | Multiple |
|---|---|---|---|---|---|
id |
The ID of application whose OAuth credential is to be updated with a new secret | String | path | Required | |
clientid |
The OAuth Credential ID to be updated with a new secret | String | path | Required |
Status Codes
| HTTP Status Code | Reason |
|---|---|
| 204 | No Content |
| 404 | Not Found |
| 500 | Internal Server Error |
Returns Class
DELETE /api/portal/v1.2/applications/{id}/oauth/{oauthId}
Summary
Delete an OAuth client ID and secret
Description
Deletes an OAuth client ID and secret. Deleting an OAuth client ID and secret means that it will no longer be accepted for OAuth application authentication.
Parameters
| Parameter | Description | Data Type | Location | Required | Multiple |
|---|---|---|---|---|---|
id |
The ID of application whose OAuth Credential is to be deleted. | String | path | Required | |
oauthId |
The OAuth Client ID to be deleted. | String | path | Required |
Status Codes
| HTTP Status Code | Reason |
|---|---|
| 204 | No Content |
| 404 | Not Found |
| 500 | Internal Server Error |
POST /api/portal/v1.2/applications/{id}/oauthresource
Summary
Adds an OAuth protected resource to an application
Description
An application must define which OAuth Protected resources it wants to access. These resources will define the scope of the application.
Parameters
| Parameter | Description | Data Type | Location | Required | Multiple |
|---|---|---|---|---|---|
id |
The ID of application requiring an OAuth protected resource. | String | path | Required | |
- |
The OAuth protected resource to add to the application | OAuthResource | body | Required |
Status Codes
| HTTP Status Code | Reason |
|---|---|
| 201 | Created |
| 204 | No Content |
| 404 | Not Found |
| 500 | Internal Server Error |
Returns Class
Example
POST https://localhost:8075/api/portal/v1.2/applications/{id}/oauthresource
Request
{"id":"512a4170-5ab5-4b4f-9c5b-e18f78011f46","applicationId":"05d2d25e-d037-4742-a1fb-eea5480ec18c","uriprefix":"/api/oauth/protected","scopes":null,"enabled":true}Response
HTTP 1.1 201 Created{
"id" : "1e71b76a-defa-49ab-96s2-a9cd60387f31",
"applicationId" : "3e21b76a-defa-49ab-9682-a9cd60387e37",
"uriprefix" : "/api/oauth/protected",
"scopes" : [ "email" ],
"enabled" : false,
"scope" : "/api/oauth/protected",
"isDefault" : false
}
GET /api/portal/v1.2/applications/{id}/oauthresource
Summary
Returns the OAuth protected resources (scopes) associated with an application
Description
Returns the OAuth protected resources (scopes) associated with an application.
Parameters
| Parameter | Description | Data Type | Location | Required | Multiple |
|---|---|---|---|---|---|
id |
The ID of application whose OAuth protected resources (Scopes) are to be returned. | String | path | Required |
Status Codes
| HTTP Status Code | Reason |
|---|---|
| 200 | OK |
| 204 | No Content |
| 404 | Not Found |
| 500 | Internal Server Error |
Returns Array
[ OAuthResource ]
PUT /api/portal/v1.2/applications/{id}/oauthresource/{resourceId}
Summary
Updates a protected resource associate with an application, sets enabled to true/false
Description
An OAuth Protected resource associated with an application can be enabled or disabled with this method.
Parameters
| Parameter | Description | Data Type | Location | Required | Multiple |
|---|---|---|---|---|---|
id |
The ID of application requiring an updated OAuth protected resource. | String | path | Required | |
resourceId |
The ID of the OAuth protected resource to update | String | path | Required | |
- |
The updated OAuth protected resource | OAuthResource | body | Required |
Status Codes
| HTTP Status Code | Reason |
|---|---|
| 200 | OK |
| 204 | No Content |
| 404 | Not Found |
| 400 | Bad Request |
| 500 | Internal Server Error |
Returns Class
Example
PUT https://localhost:8075/api/portal/v1.2/applications/{id}/oauthresource/{resourceId}
Request
{"id":"512a4170-5ab5-4b4f-9c5b-e18f78011f46","applicationId":"05d2d25e-d037-4742-a1fb-eea5480ec18c","uriprefix":"/api/oauth/protected","scopes":null,"enabled":false}Response
HTTP 1.1 201 Created{
"id" : "1e71b76a-defa-49ab-96s2-a9cd60387f31",
"applicationId" : "3e21b76a-defa-49ab-9682-a9cd60387e37",
"uriprefix" : "/api/oauth/protected",
"scopes" : [ "email" ],
"enabled" : false,
"scope" : "/api/oauth/protected",
"isDefault" : false
}
DELETE /api/portal/v1.2/applications/{id}/oauthresource/{resourceId}
Summary
Remove an OAuth protected resource from an application
Description
Removes the association between an application and an OAuth protected resource on the API Server. The application will no longer have the scope associated with the resource. Tokens issued prior to the removal will still be scoped for the resource.
Parameters
| Parameter | Description | Data Type | Location | Required | Multiple |
|---|---|---|---|---|---|
id |
The ID of application whose protected resource is to be removed. | String | path | Required | |
resourceId |
The uri of the OAuth protected resource to be disassociated from the application. | String | path | Required |
Status Codes
| HTTP Status Code | Reason |
|---|---|
| 204 | No Content |
| 404 | Not Found |
| 500 | Internal Server Error |
POST /api/portal/v1.2/applications/{id}/permissions
Summary
Create a new permission.
Description
Add a new access-control entry to the application's ACL. Management privilege required.
Parameters
| Parameter | Description | Data Type | Location | Required | Multiple |
|---|---|---|---|---|---|
id |
The application ID. | String | path | Required | |
- |
API Manager application permission. | PermissionDTO | body | Required |
Status Codes
| HTTP Status Code | Reason |
|---|---|
| 201 | Created |
| 404 | Not Found |
| 403 | Forbidden |
| 500 | Internal Server Error |
Returns Class
Example
POST https://localhost:8075/api/portal/v1.2/applications/{id}/permissions
Request
{
"id" : "46a6e874-a341-4c2d-870e-55e4c6ec27dc",
"userId" : "46a6e874-a341-4c2d-870e-55e4c6ec27dc",
"permission" : "manage",
"createdBy" : "de077cd8-83b7-46d1-b06f-2eaaf1548898",
"createdOn" : 1364407145121
}Response
HTTP 1.1 200 OK{
"id" : "46a6e874-a341-4c2d-870e-55e4c6ec27dc",
"userId" : "46a6e874-a341-4c2d-870e-55e4c6ec27dc",
"permission" : "manage",
"createdBy" : "de077cd8-83b7-46d1-b06f-2eaaf1548898",
"createdOn" : 1364407145121
}
GET /api/portal/v1.2/applications/{id}/permissions
Summary
Get the list of permissions.
Description
Get the access-control list (ACL) for the application. Callers with view-only privilege can only access their own permission.
Parameters
| Parameter | Description | Data Type | Location | Required | Multiple |
|---|---|---|---|---|---|
id |
The application ID. | String | path | Required |
Status Codes
| HTTP Status Code | Reason |
|---|---|
| 200 | OK |
| 403 | Forbidden |
| 500 | Internal Server Error |
Returns Array
[ PermissionDTO ]
PUT /api/portal/v1.2/applications/{id}/permissions/{permId}
Summary
Modify a permission
Description
Modify an existing access-control entry from the application's ACL. Management privilege required.
Parameters
| Parameter | Description | Data Type | Location | Required | Multiple |
|---|---|---|---|---|---|
id |
The application ID. | String | path | Required | |
permId |
The permission ID. | String | path | Required | |
- |
API Manager application permission. | PermissionDTO | body | Required |
Status Codes
| HTTP Status Code | Reason |
|---|---|
| 200 | OK |
| 404 | Not Found |
| 400 | Bad Request |
| 403 | Forbidden |
| 500 | Internal Server Error |
Returns Class
Example
PUT https://localhost:8075/api/portal/v1.2/applications/{id}/permissions/{permId}
Request
{
"id" : "46a6e874-a341-4c2d-870e-55e4c6ec27dc",
"userId" : "46a6e874-a341-4c2d-870e-55e4c6ec27dc",
"permission" : "manage",
"createdBy" : "de077cd8-83b7-46d1-b06f-2eaaf1548898",
"createdOn" : 1364407145121
}Response
HTTP 1.1 200 OK{
"id" : "46a6e874-a341-4c2d-870e-55e4c6ec27dc",
"userId" : "46a6e874-a341-4c2d-870e-55e4c6ec27dc",
"permission" : "manage",
"createdBy" : "de077cd8-83b7-46d1-b06f-2eaaf1548898",
"createdOn" : 1364407145121
}
DELETE /api/portal/v1.2/applications/{id}/permissions/{permId}
Summary
Remove a permission
Description
Remove an existing access-control entry from the application's ACL. Management privilege required.
Parameters
| Parameter | Description | Data Type | Location | Required | Multiple |
|---|---|---|---|---|---|
id |
The application ID. | String | path | Required | |
permId |
The permission ID. | String | path | Required |
Status Codes
| HTTP Status Code | Reason |
|---|---|
| 204 | No Content |
| 404 | Not Found |
| 403 | Forbidden |
| 500 | Internal Server Error |
POST /api/portal/v1.2/applications/{id}/quota
Summary
Creates a new quota constraint for the application
Description
Creates a new quota constraint for the application.
Parameters
| Parameter | Description | Data Type | Location | Required | Multiple |
|---|---|---|---|---|---|
id |
The ID of application for the quota contraint. | String | path | Required | |
- |
The Quota is a set of restrictions that apply to applications in the Portal. | QuotaDTO | body | Required |
Status Codes
| HTTP Status Code | Reason |
|---|---|
| 201 | Created |
| 400 | Bad Request |
| 404 | Not Found |
| 500 | Internal Server Error |
Returns Class
Example
POST https://localhost:8075/api/portal/v1.2/applications/{id}/quota
Request
{"type":"APPLICATION","name":"iPhone App Quota","description":"","restrictions":[{"api":"f88f1648-d0f0-42a9-af99-d610154ab7dd","method":"c1c49b19-5877-4b51-9cbb-93a02c09d861","type":"throttle","config":{"period":"second","messages":50,"per":10}}]}Response
HTTP 1.1 201 Created{
"id" : "a1c70859-702b-4f3a-a1ad-a61067fdc4c7",
"type" : "APPLICATION",
"name" : "MyApplication Quota",
"description" : "A set of restrictions to MyApplication",
"restrictions" : [ {
"api" : "60d1c7da-9e2e-4f57-948a-eeb1da71beca",
"method" : "0c5f8a4a-0e74-4e66-ad7b-e21962940e02",
"type" : "throttle",
"config" : {
"messages" : "10",
"per" : "1",
"period" : "seconds"
}
} ],
"system" : false
}
PUT /api/portal/v1.2/applications/{id}/quota
Summary
Updates a quota contraint for an application
Description
Updates a quota contraint for the given application.
Parameters
| Parameter | Description | Data Type | Location | Required | Multiple |
|---|---|---|---|---|---|
id |
The ID of application who's quota is to be updated. | String | path | Required | |
- |
The Quota is a set of restrictions that apply to applications in the Portal. | QuotaDTO | body | Required |
Status Codes
| HTTP Status Code | Reason |
|---|---|
| 200 | OK |
| 400 | Bad Request |
| 404 | Not Found |
| 500 | Internal Server Error |
Returns Class
Example
PUT https://localhost:8075/api/portal/v1.2/applications/{id}/quota
Request
{"type":"APPLICATION","name":"iPhone App Quota","description":"","restrictions":[{"api":"f88f1648-d0f0-42a9-af99-d610154ab7dd","method":"c1c49b19-5877-4b51-9cbb-93a02c09d861","type":"throttle","config":{"period":"hour","messages":50,"per":10}}]}Response
HTTP 1.1 200 OK{
"id" : "a1c70859-702b-4f3a-a1ad-a61067fdc4c7",
"type" : "APPLICATION",
"name" : "MyApplication Quota",
"description" : "A set of restrictions to MyApplication",
"restrictions" : [ {
"api" : "60d1c7da-9e2e-4f57-948a-eeb1da71beca",
"method" : "0c5f8a4a-0e74-4e66-ad7b-e21962940e02",
"type" : "throttle",
"config" : {
"messages" : "10",
"per" : "1",
"period" : "seconds"
}
} ],
"system" : false
}
DELETE /api/portal/v1.2/applications/{id}/quota
Summary
Deletes a quota from an application
Description
Deletes a quota from an application
Parameters
| Parameter | Description | Data Type | Location | Required | Multiple |
|---|---|---|---|---|---|
id |
The ID of application who's quota constraint is to be deleted. | String | path | Required |
Status Codes
| HTTP Status Code | Reason |
|---|---|
| 400 | Bad Request |
| 204 | No Content |
| 404 | Not Found |
| 500 | Internal Server Error |
GET /api/portal/v1.2/applications/{id}/quota
Summary
Returns the quota associated with an application.
Description
Returns the quota associated with an application.
Parameters
| Parameter | Description | Data Type | Location | Required | Multiple |
|---|---|---|---|---|---|
id |
The ID of application who's quota constraints are to be returned. | String | path | Required |
Status Codes
| HTTP Status Code | Reason |
|---|---|
| 200 | OK |
| 500 | Internal Server Error |
Returns Array
[ QuotaDTO ]
POST /api/portal/v1.2/applications/{id}/scope
Summary
Adds an OAuth protected resource to an application
Description
An application must define which scopes it wants to access. These define the scope of the application.
Parameters
| Parameter | Description | Data Type | Location | Required | Multiple |
|---|---|---|---|---|---|
id |
The ID of application requiring an OAuth scope. | String | path | Required | |
- |
The OAuth Scope to add to the application | OAuthAppScope | body | Required |
Status Codes
| HTTP Status Code | Reason |
|---|---|
| 201 | Created |
| 204 | No Content |
| 404 | Not Found |
| 500 | Internal Server Error |
Returns Class
Example
POST https://localhost:8075/api/portal/v1.2/applications/{id}/scope
Request
{"id":"512a4170-5ab5-4b4f-9c5b-e18f78011f46","applicationId":"05d2d25e-d037-4742-a1fb-eea5480ec18c","scope":"/api/oauth/protected","scopes":null,"enabled":true}Response
HTTP 1.1 201 Created{
"id" : "1e71b76a-defa-49ab-96s2-a9cd60387f31",
"applicationId" : "3e21b76a-defa-49ab-9682-a9cd60387e37",
"scope" : "/api/oauth/protected",
"isDefault" : false
}
GET /api/portal/v1.2/applications/{id}/scope
Summary
Returns the scopes associated with an application
Description
Returns the OAuth scopes associated with an application.
Parameters
| Parameter | Description | Data Type | Location | Required | Multiple |
|---|---|---|---|---|---|
id |
The ID of application whose OAuth protected resources (Scopes) are to be returned. | String | path | Required |
Status Codes
| HTTP Status Code | Reason |
|---|---|
| 200 | OK |
| 204 | No Content |
| 404 | Not Found |
| 500 | Internal Server Error |
Returns Array
[ Set ]
PUT /api/portal/v1.2/applications/{id}/scope/{scopeId}
Summary
Updates a scope associated with an application, sets default to true/false
Description
An OAuth Scope associated with an application can be set or unset as a default scope with this method.
Parameters
| Parameter | Description | Data Type | Location | Required | Multiple |
|---|---|---|---|---|---|
id |
The ID of application requiring an updated OAuth protected resource. | String | path | Required | |
scopeId |
The ID of the Application Scope to update | String | path | Required | |
- |
The updated OAuth protected resource | OAuthAppScope | body | Required |
Status Codes
| HTTP Status Code | Reason |
|---|---|
| 200 | OK |
| 204 | No Content |
| 404 | Not Found |
| 400 | Bad Request |
| 500 | Internal Server Error |
Returns Class
Example
PUT https://localhost:8075/api/portal/v1.2/applications/{id}/scope/{scopeId}
Request
{"id":"512a4170-5ab5-4b4f-9c5b-e18f78011f46","applicationId":"05d2d25e-d037-4742-a1fb-eea5480ec18c","uriprefix":"/api/oauth/protected","scopes":null,"enabled":false}Response
HTTP 1.1 201 Created{
"id" : "1e71b76a-defa-49ab-96s2-a9cd60387f31",
"applicationId" : "3e21b76a-defa-49ab-9682-a9cd60387e37",
"scope" : "/api/oauth/protected",
"isDefault" : false
}
DELETE /api/portal/v1.2/applications/{id}/scope/{scopeId}
Summary
Remove an OAuth protected resource from an application
Description
Removes the association between an application and an OAuth protected resource on the API Server. The application will no longer have the scope associated with the resource. Tokens issued prior to the removal will still be scoped for the resource.
Parameters
| Parameter | Description | Data Type | Location | Required | Multiple |
|---|---|---|---|---|---|
id |
The ID of application whose protected resource is to be removed. | String | path | Required | |
scopeId |
The id of the Scope to be disassociated from the application. | String | path | Required |
Status Codes
| HTTP Status Code | Reason |
|---|---|
| 204 | No Content |
| 404 | Not Found |
| 500 | Internal Server Error |