Resetting an App Code
Function
This API is used to reset a specified app code of an API Gateway app. Only the user who creates the app can reset it, and only apps of the shared or dedicated API Gateway can have app codes.
Debugging
You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.
URI
PUT /v1/{project_id}/app-auth/apps/{app_id}/app-code/{app_code}
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
app_code |
Yes |
String |
App code to be reset |
app_id |
Yes |
String |
App ID, which can be obtained by calling the API for obtaining the app list |
project_id |
Yes |
String |
Project ID. For details, see Obtaining a Project ID and Name. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
Content-Type |
No |
String |
Message body type. text/plain indicates that a temporary preview URL is returned. application/octet-stream indicates that a temporary download URL is returned. |
X-Auth-Token |
Yes |
String |
User token. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
app_name |
Yes |
String |
App name. |
app_remark |
No |
String |
App remarks. |
workspace_id |
No |
String |
Workspace ID. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
app |
ApigAppDetailInfo object |
Basic information about the created app |
Parameter |
Type |
Description |
---|---|---|
app_codes |
Array of strings |
App code list. When app_type is APIC, this parameter is left blank. |
app_id |
String |
App ID |
app_key |
String |
App key |
app_name |
String |
App name |
app_remark |
String |
App description, which is left blank by default. The value contains a maximum of 200 characters. |
app_secret |
String |
App secret key |
app_type |
String |
App type. Enums:
|
bounded_api_count |
Integer |
Number of APIs bound to the app |
created_at |
Long |
Time when an app is created |
project_id |
String |
Project ID |
updated_at |
Long |
App update time |
user_id |
String |
ID of the user who creates the app |
Status code: 401
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error codes of ModelArts. |
error_msg |
String |
Error message. |
Status code: 403
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error codes of ModelArts. |
error_msg |
String |
Error message. |
Status code: 404
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error codes of ModelArts. |
error_msg |
String |
Error message. |
Example Requests
PUT https://{endpoint}/v1/{project_id}/app-auth/apps/{app_id}/app-code/{app_code} { "workspace_id" : "0", "app_name" : "app_test", "app_remark" : "test" }
Example Responses
Status code: 200
OK
{ "app" : { "app_id" : "f29eddd1443e4dceb76898f881c07a4d", "app_name" : "app_xq0XT", "app_remark" : "autotest", "app_key" : "bcb835430eab4c72bd45e2315d98fdb9", "app_secret" : "80dc4ab97b34456fbf73a04e83164a1b", "user_id" : "04f258c8fb00d42a1f65c00df88cc4dc", "project_id" : "04f258c84780d5a52f3bc00dc15aa5e7", "app_type" : "APIG", "app_codes" : [ "873810a2cd4e4a9c88df5979411d6a50753c0af4024840fcac59e37ce38364e4" ], "created_at" : 1698745606957, "updated_at" : 1703162907779, "bounded_api_count" : 0 } }
Status Codes
Status Code |
Description |
---|---|
200 |
OK |
401 |
Unauthorized |
403 |
Forbidden |
404 |
Not Found |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot