Response
Status Codes
After sending a request, you will receive a response, including a status code, response header, and response body.
A status code is a group of digits, ranging from 1xx to 5xx. It indicates the status of a request. For more information, see Status Codes.
If status code 200 is returned for the calling of Pangu APIs, the request is successful.
Response Header
Similar to a request, a response also has a header, for example, Content-Type.
Response Body
The body of a response is often returned in structured format as specified in the Content-Type header field. The response body transfers content except the response header.
The following is a response body of a successful API call:
{ "id": "180f5745-4ee4-42a9-9869-23f829654bb7", "created": 1724915285, "choices": [ { "index": 0, "text": "Once upon a time, in a land far, far away, there was a kingdom called Eldoria. Eldoria was a kingdom of great beauty, with lush green forests, sparkling rivers, and majestic mountains. The kingdom was ruled by a wise and just king, King Alaric, and his queen, Queen Isolde. They had a son, Prince Aiden, who was brave and kind, and a daughter, Princess Elara, who was beautiful and intelligent. Prince Aiden and Princess Elara were very close. They grew up together, playing in the gardens, exploring the forests, and learning about their kingdom. As they grew older, their bond deepened, and they realized that they had fallen in love with each other. However, their love was not without challenges. King Alaric and Queen Isolde had other plans for their children. They wanted Prince Aiden to marry a princess from a neighboring kingdom to form an alliance, and they wanted Princess Elara to marry a prince from a distant land to strengthen their kingdom's power. Prince Aiden and Princess Elara were heartbroken. They knew that they had to do something to be together. One night, they decided to run away from the palace and elope. They packed their bags and left the palace under the cover of darkness. They traveled through the forests and mountains, facing many dangers along the way. But their love for each other gave them the strength to overcome every obstacle. They finally reached a small village on the outskirts of Eldoria, where they decided to settle down. They lived a simple life in the village, working hard and loving each other deeply. They were happy, but they knew that they could not stay hidden forever. One day, King Alaric and Queen Isolde found out about their escape and came to the village to bring them back. Prince Aiden and Princess Elara pleaded with their parents to let them stay together. They told them about their love and how they could not imagine living without each other. King Alaric and Queen Isolde were moved by their love and decided to let them stay together. They returned to the palace and announced their decision to the kingdom. The people of Eldoria were overjoyed and celebrated the union of Prince Aiden and Princess Elara. They were married in a grand ceremony, and their love story became a legend in Eldoria. Prince Aiden and Princess Elara ruled Eldoria together, bringing peace and prosperity to the kingdom. Their love story inspired many, and their kingdom flourished under their rule. They lived happily ever after, proving that true love can overcome any obstacle. "ppl": 1.77809815678146e-36 } ], "usage": { "completion_tokens": 365, "prompt_tokens": 9, "total_tokens": 374 } }
If an error occurs during API calling, an error code and error information will be returned.
The token is valid for 24 hours. The following error information indicates that the token has expired. { "error_msg": "Incorrect IAM authentication information: token expires, expires_at:2023-06-29T02:16:41.581000Z", "error_code": "APIG.0301", "request_id": "469967f55e6b225xxx" }
In the response body, error_code is an error code, and error_msg provides information about the 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