Home Page > POST api/requests/save

Creates a request depend on a posted request model. The columns in the request model are required for configurations.

Examples

C#

string url = "https://iamgaoapiurl/api/requests/save";
            string logonToken = GetLogonToken();
            APIRequest requestInfo = GetRequestInfo();
            HttpWebRequest httpRequest = (HttpWebRequest)HttpWebRequest.Create(url);
            httpRequest.ContentType = "application/json";
            ServicePointManager.ServerCertificateValidationCallback += ((sender, certificate, chain, sslPolicyErrors) => true);
            httpRequest.Method = "POST";
            httpRequest.Headers.Set("X_GovernanceAutomation_Access_Token", logonToken);
            
            //Write the login information to the web request.
            System.Text.UTF8Encoding encoding = new System.Text.UTF8Encoding();
            byte[] data = encoding.GetBytes(JsonConvert.SerializeObject(requestInfo));
            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.
            JObject request = null;
            HttpWebResponse response = (HttpWebResponse)httpRequest.GetResponse();
            using (Stream responseStream = response.GetResponseStream())
            {
                using (StreamReader responseReader = new StreamReader(responseStream, Encoding.UTF8))
                {
                    string reply = responseReader.ReadToEnd();
                }
            }
            Guid newRequestId = JsonConvert.DeserializeObject (requestInfo);

Body Parameters

APIRequest

Request Information

URI Parameters

NameDescriptionType
Id

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

globally unique identifier
RequestId

Gets the request ID of a request. The request ID is displayed on Governance Automation Online interface for reference and tracking.

integer
ServiceId

Gets or sets the service ID.

globally unique identifier
Department

Gets or sets the department specified for the request.

string
RequestSummary

Gets or sets the summary of a request.

string
NotesToApprover

Gets or sets the notes to approvers of a request.

string
IsDeleted

Gets or sets a boolean value that specifies whether a request has been deleted.

boolean
Type

Gets or sets the type of the service from which a request is started.

integer
Requester

Gets or sets the login name of the user who creates a request.

string
Status

Gets or sets the value to indicate whether a request is saved or submitted.

APIRequestStatus
ProgressStatus

Gets or sets the status of processing a request.

APIRequestProgressStatus
Submitted

Gets or sets the submitted time of a request.

date
Modified

Gets or sets the last modified time of a request.

date
Created

Gets or sets the created time of a request.

date
AssignTo

Gets or sets the user that the request is assigned to. It is the approver.

string
WorkflowInstaceID

Gets or sets the approval process instance ID of a request.

globally unique identifier
MetadataList

Gets or sets the custom metadata that is applied to a request.

Collection of APIRequestMetadata

Request Formats

application/json, text/json

Sample:
{
  "Id": "ee30157e-c71a-4dca-838d-cf23f5d36c63",
  "RequestId": "99",
  "ServiceId": "cbb5da02-5b38-4d5a-8b0b-115542903458",
  "Department": "sample string 3",
  "RequestSummary": "sample string 4",
  "NotesToApprover": "sample string 6",
  "IsDeleted": true,
  "Type": 8,
  "Requester": "sample string 9",
  "Status": 0,
  "ProgressStatus": 0,
  "Submitted": "2015-04-16T15:23:42.72367+08:00",
  "Modified": "2015-04-16T15:23:42.72367+08:00",
  "Created": "2015-04-16T15:23:42.72367+08:00",
  "AssignTo": "sample string 12",
  "WorkflowInstaceID": "cc2e2857-1539-4dcd-b3bb-5ece6a5a0a93",
  "MetadataList": [
    {
      "ID": "0feddbce-3860-4219-b739-1f2caa958163",
      "Name": "sample string 2",
      "Value": "sample string 3"
    },
    {
      "ID": "0feddbce-3860-4219-b739-1f2caa958163",
      "Name": "sample string 2",
      "Value": "sample string 3"
    }
  ]
}

application/xml, text/xml

Sample:
<APIRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.avepoint.com">
  <AssignTo>sample string 12</AssignTo>
  <Created>2015-04-16T15:23:42.72367+08:00</Created>
  <Department>sample string 3</Department>
  <IsDeleted>true</IsDeleted>
  <MetadataList xmlns:d2p1="http://schemas.datacontract.org/2004/07/AvePoint.GA.WebAPI.Models.Settings">
    <d2p1:APIRequestMetadata>
      <d2p1:ID>0feddbce-3860-4219-b739-1f2caa958163</d2p1:ID>
      <d2p1:Name>sample string 2</d2p1:Name>
      <d2p1:Value>sample string 3</d2p1:Value>
    </d2p1:APIRequestMetadata>
    <d2p1:APIRequestMetadata>
      <d2p1:ID>0feddbce-3860-4219-b739-1f2caa958163</d2p1:ID>
      <d2p1:Name>sample string 2</d2p1:Name>
      <d2p1:Value>sample string 3</d2p1:Value>
    </d2p1:APIRequestMetadata>
  </MetadataList>
  <Modified>2015-04-16T15:23:42.72367+08:00</Modified>
  <NotesToApprover>sample string 6</NotesToApprover>
  <ProgressStatus>None</ProgressStatus>
  <Id>ee30157e-c71a-4dca-838d-cf23f5d36c63</Id>
  <RequestId>99</RequestId>
  <Requester>sample string 9</Requester>
  <ServiceId>cbb5da02-5b38-4d5a-8b0b-115542903458</ServiceId>
  <Status>Saved</Status>
  <Submitted>2015-04-16T15:23:42.72367+08:00</Submitted>
  <RequestSummary>sample string 4</RequestSummary>
  <Type>8</Type>
  <WorkflowInstaceID>cc2e2857-1539-4dcd-b3bb-5ece6a5a0a93</WorkflowInstaceID>
</APIRequest>

Response Information

globally unique identifier

Response Formats

application/json, text/json

Sample:
"90b3da8d-95e4-4539-b86a-d53a3e85a3ac"

application/xml, text/xml

Sample:
<guid xmlns="http://schemas.microsoft.com/2003/10/Serialization/">90b3da8d-95e4-4539-b86a-d53a3e85a3ac</guid>