Authorizing Apps
Function
An app cannot access any APIs immediately after it is created. To access an API in an environment, first authorize the app to call the API.
URI
The following table lists the HTTP/HTTPS request method and URI of the API.
| 
        Request Method  | 
      
        URI  | 
     
|---|---|
| 
        POST  | 
      
        /v1.0/apigw/app-auths  | 
     
Request
| 
        Parameter  | 
      
        Mandatory  | 
      
        Type  | 
      
        Description  | 
     
|---|---|---|---|
| 
        api_ids  | 
      
        Yes  | 
      
        Array of strings  | 
      
        List of API IDs  | 
     
| 
        app_ids  | 
      
        Yes  | 
      
        Array of strings  | 
      
        List of app IDs  | 
     
| 
        env_id  | 
      
        Yes  | 
      
        String  | 
      
        ID of the environment in which the apps will be authorized  | 
     
Example request:
{
	"api_ids": ["5bbc47e2-95b0-4a56-904e-a3cdc422f8e9",
	"6632a062-9dcf-4f18-9646-3cabb925a290"],
	"app_ids": ["14b399ac-967f-4115-bb62-c0346b4537e9"],
	"env_id": "DEFAULT_ENVIRONMENT_RELEASE_ID"
}
 Response
| 
        Parameter  | 
      
        Type  | 
      
        Description  | 
     
|---|---|---|
| 
        --  | 
      
        Dictionary  | 
      
        Authorization list  | 
     
| 
        Parameter  | 
      
        Type  | 
      
        Description  | 
     
|---|---|---|
| 
        id  | 
      
        String  | 
      
        Authorization ID  | 
     
| 
        api_id  | 
      
        String  | 
      
        API ID  | 
     
| 
        app_id  | 
      
        String  | 
      
        App ID  | 
     
| 
        auth_time  | 
      
        Timestamp  | 
      
        Authorization time  | 
     
| 
        auth_role  | 
      
        String  | 
      
        Authorizer, which can be: PROVIDER CONSUMER  | 
     
| 
        auth_result  | 
      
        String  | 
      
        Authorization result, which can be: SUCCESS SKIPPED  | 
     
Example response:
[{
	"id": "dffcaff92d144135a9f420fcd485bbf3",
	"api_id": "8aa097b00e9843efabc9c593d11b769d",
	"app_id": "f8c6ea15-0d1b-4c5b-bd4b-911610bd3b3e",
	"auth_time": "2018-03-30T09:37:43.490197204Z",
	"auth_role": "PROVIDER",
	"auth_result": "SUCCESS"
}]
 Status Codes
| 
        Status Code  | 
      
        Description  | 
     
|---|---|
| 
        201  | 
      
        Created  | 
     
| 
        400  | 
      
        Bad Request  | 
     
| 
        401  | 
      
        Unauthorized  | 
     
| 
        403  | 
      
        Forbidden  | 
     
| 
        404  | 
      
        Not Found  | 
     
| 
        409  | 
      
        Conflict  | 
     
| 
        500  | 
      
        Server Internal Error  | 
     
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