Application & Process Automation
- Getting Started
- Common Usage Scenarios
- Troubleshooting
- Using Custom IDs
- API Method Reference
-
- GetPrograms
- GetForms
- GetFormSchema
- GetProjects
- GetProjectsByNumber
- GetProjectsByData
- CreateNewProject
- GetAllProjectData - Admin only
- GetProjectData
- SetProjectData
- GetActiveAttachment
- GetAttachmentAsAdmin – Admin only
- SetProjectAttachment
- SetAttachmentMetadata
- GetAttachmentMetadata
- SubmitProject
- GetStatusList – Admin only
- GetCustomListChoices
- GetProjectStatusHistory – Admin only
- SetProjectStatus – Admin only
- GetExportProject – Admin only
- CreateMfaSessionToken
- DeleteMfaSessionToken
- SetAssignee
- SetProjectOwner
- GetInquiryThreads – Admin Only
- GetNotesInInquiryThread – Admin Only
- SetInquiryNote – Admin Only
- SetInquiryThreadStatus – Admin Only
- SetInquiryThreadExternalId – Admin Only
- SetProjectStatusReportAs – Admin only
- Code Samples
GetStatusList – Admin only
Get a list of the workflow statuses associated with the given program. Requires membership in an administrator role and read access to the program.
HTTP verb: GET
Required inputs: ProgramId
HTTP verb: GET
Required inputs: ProgramId
<StatusResponse>
<StatusList>
<Status StatusId="U11N9F91" CustomId="MyStatus" Name="Application Review" />
<Status StatusId="VG4AE6KA" Name="Cancelled" />
<Status StatusId="SK9XZ20J" Name="Denied" />
<Status StatusId="759NA6NH" Name="Inspection Pending" />
<Status StatusId="U2KE36T4" Name="Permission to Operate" />
<Status StatusId="HA8MX4B3" Name="Suspended" />
<Status StatusId="3X8KK600" Name="Unsubmitted" />
<Status StatusId="N00NU0QR" Name="Withdrawn" />
</StatusList>
</StatusResponse>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://service.powerclerk.com/api/v1/">
<xs:element name="StatusResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="StatusList">
<xs:complexType>
<xs:sequence>
<xs:element name="Status" maxOccurs="unbounded" minOccurs="0">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute type="xs:string" name="StatusId" use="required"/>
<xs:attribute type="xs:string" name="CustomId" use="optional"/>
<xs:attribute type="xs:string" name="Name" use="required"/>
<xs:attribute type="xs:boolean" name="Deleted" use="required"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute type="xs:float" name="SchemaVersion"/>
</xs:complexType>
</xs:element>
</xs:schema>
// Retrieves information for all the workflow statuses in the given program.
// Returns a list of <StatusId, StatusName, IsDeleted> tuples, one for each status in the program.
public List<Tuple<string, string, string>> GetStatusInfo(string programId, string username, string password, string apiKey)
{
string url = "/Programs/" + programId + "/StatusList";
XDocument xmlResponse = MakeGetRequest(BaseUrl + url, username, password, apiKey);
XNamespace ns = "http://service.powerclerk.com/api/v1/";
List<XElement> statusElements = xmlResponse.Descendants(ns + "Status").ToList();
List<Tuple<string, string, string>> statusInfo = new List<Tuple<string, string, string>>();
foreach (XElement element in statusElements)
{
string statusId = element.Attribute("StatusId").Value;
string statusName = element.Attribute("Name").Value;
string isDeleted = element.Attribute("Deleted").ToString();
statusInfo.Add(new Tuple<string, string, string>(statusId, statusName, isDeleted));
}
return statusInfo;
}
function getStatusList(programId) {
// Use $.ajax jQuery method to execute the API call
$.ajax({
type: "GET",
url: "https://{BaseURL}/Programs/" + programId + "/StatusList",
dataType: "xml",
beforeSend: function (xhr) {
xhr.setRequestHeader("Authorization", "Basic " + hashedCredentials);
xhr.setRequestHeader("X-ApiKey", apiKey);
},
success: function (xml) {
// Display data
},
error: function (xhr) {
// Display error
}
});
}
See Chapter Code Samples for MakeGetRequest sample code.
What’s Next?