POST OAuth/CreateApplication
Creates a new OAuth application.
Authorization
- Roles: Admin. See OAuth roles for more information.
- Token scope: Admin
Headers
-
Content type: Content-Type:application/json.
- Token: The bearer access token that you received. For example, Authorization:Bearer 4MyGeneratedBearerTknz==. For more information, see Passing a bearer token in your API calls.
Parameters
Order |
Name |
Description |
---|---|---|
1 |
ApplicationId string |
|
2 |
Scope string |
|
3 |
MaximumScope string |
|
4 |
Name string |
|
5 |
Vendor string |
|
6 |
Description string |
|
7 |
Url string |
|
8 |
AccessValidity integer |
The seconds a token for this application should be valid. Not passing a value uses the system default. |
9 |
GrantValidity integer |
The seconds a grant for this application should be valid. Not passing a value uses the system default. |
10 |
Renewable boolean |
|
Returns
Name |
Description |
---|---|
HTTP 200 |
See OAuth result codes. An Application object is returned showing the values passed in the parameters listed in the Request section above. |
HTTP 400 |
For invalid requests, this call returns HTTP 400 Bad Request and the following data in the message body:
|
HTTP 401 |
For authentication errors, this call returns HTTP 401 Unauthorized and the following data in the message body:
|
HTTP 403 |
If the response is HTTP 403 Forbidden, the requester's token does not include the admin scope. Call POST Authorize/OAuth with the correct scope and restriction. Update the header with the new token and retry.
|
Example
Request
POST /vedsdk/oauth/CreateApplication HTTP/1.1 Host: tpp-server-url Content-Type: application/json Accept: application/json Authorization: Bearer 4MyGeneratedBearerTknz== { "ApplicationId": "NewApplicationID", "Scope": "certificate", "MaxScope": "admin", "Name": "Name of the new application", "Vendor": "My Company, LLC", "Description": "This is the application description.", "Url": "help.sample-url.com" }
Response
{ "Application": { "Description": "This is the application description", "ID": "NewApplicationID", "MaximumScope": "admin", "Name": "Name of the new application", "Scope": "certificate", "Url": "help.sample-url.com", "Vendor": "My Company, LLC" }, "Result": 0, "Success": true }