Home Page > POST api/requests/cancel

Cancels a request by request ID.

Examples

C#

Guid requestId = GetRequestId();
            var cancelInfo = new
            {
                Id = requestId.ToString(),
                Comment = "cancel test"
            };
            string url = "https://iamgaoapiurl/api/requests/cancel";
            HttpWebRequest httpRequest = (HttpWebRequest)HttpWebRequest.Create(url);
            httpRequest.ContentType = "application/json";
            ServicePointManager.ServerCertificateValidationCallback += ((sender, certificate, chain, sslPolicyErrors) => true);
            httpRequest.Method = "POST";
             
            //Write the login information to the web request.
            System.Text.UTF8Encoding encoding = new System.Text.UTF8Encoding();
            byte[] data = encoding.GetBytes(JsonConvert.SerializeObject(cancelInfo));
            httpRequest.ContentLength = data.Length;
            using (Stream requestStream = httpRequest.GetRequestStream())
            {
                requestStream.Write(data, 0, data.Length);
            }
            
            //Get response on the web request from Governance Automation Online Web API.
            HttpWebResponse response = (HttpWebResponse)httpRequest.GetResponse();
            using (Stream responseStream = response.GetResponseStream())
            {
                using (StreamReader responseReader = new StreamReader(responseStream, Encoding.UTF8))
                {
                    string reply = responseReader.ReadToEnd();
                }
            };

Body Parameters

APIRequestCancelModel

Request Information

URI Parameters

NameDescriptionType
Id

Gets the ID of a request that is stored as a record in Governance Automation Online databases.

string
Comment

Gets or set the comment for cancelling the request.

string

Request Formats

application/json, text/json

Sample:
{
  "Id": "sample string 1",
  "Comment": "sample string 2"
}

application/xml, text/xml

Sample:
<APIRequestCancelModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.avepoint.com">
  <Comment>sample string 2</Comment>
  <Id>sample string 1</Id>
</APIRequestCancelModel>

Response Information

boolean

Response Formats

application/json, text/json

Sample:
true

application/xml, text/xml

Sample:
<boolean xmlns="http://schemas.microsoft.com/2003/10/Serialization/">true</boolean>