Application & Process Automation

Getting Started
Authentication & Access
Accounts with Multi-Factor Authentication
Using method GetPrograms
Common Usage Scenarios
Create and Submit a Project
Add/Change Data in an Existing Project
Daily Polling for Project Changes
Troubleshooting
Using Custom IDs
API Method Reference
GetPrograms
URL Format
Response
XML Attributes
Sample Code
GetForms
URL Format
Response
Forms Attributes
AvailableInStatuses and LeadsToStatus
Status Attributes
Sample Code
GetFormSchema
V1 Response
V2 Response
Sample Code
GetProjects
V1 Response
V2 Response
V3 Response
Sample Code
GetProjectsByNumber
V1 Response
V2 Response
Sample Request
Sample Code
GetProjectsByData
Sample Request
Request XML Nodes and Attributes
V1 Response
V2 Response
CreateNewProject
Sample Response
Response XML Attributes
Sample Code
GetAllProjectData - Admin only
Sample Response
XML Attributes
Sample Code
GetProjectData
Sample Response
XML Attributes
Sample Code
SetProjectData
Sample Request
Request XML Attributes
Sample Response
Response XML Attributes
Sample Code
GetActiveAttachment
URL Format
Sample Code
GetAttachmentAsAdmin – Admin only
URL Format
SetProjectAttachment
Identifying attachment file types
URL Format
Sample Response
Response XML Attributes
Sample Code
SetAttachmentMetadata
Sample Request
Request XML Attributes
Sample Response
Response XML Attributes
Sample Code
GetAttachmentMetadata
URL Format
Sample Response
Response XML Attributes
Sample Code
SubmitProject
URL Format
Sample Response
Response XML Attributes
Sample Code
GetStatusList – Admin only
Sample Code
URL Format
Sample Response
Response XML Attributes
GetCustomListChoices
URL Format
Sample Response
Response XML Attributes
GetProjectStatusHistory – Admin only
URL Format
Sample Response
Response XML Attributes
Sample Code
SetProjectStatus – Admin only
URL Format
Sample Response
Response XML Attributes
Sample Code
GetExportProject – Admin only
Response XML Attributes
Sample Code
URL Format
Sample Response
CreateMfaSessionToken
URL Format
Sample Request
Request XML Attributes
Sample Response
Response XML Attributes
Sample Code
DeleteMfaSessionToken
URL Format
Sample Response
Sample Code
SetAssignee
URL Format
Sample Request
Request XML Attributes
Sample Response
Response XML Attributes
SetProjectOwner
URL Format
Sample Request
Request XML Attributes
Sample Response
Response XML Attributes
GetInquiryThreads – Admin Only
GetNotesInInquiryThread – Admin Only
SetInquiryNote – Admin Only
SetInquiryThreadStatus – Admin Only
SetInquiryThreadExternalId – Admin Only
SetProjectStatusReportAs – Admin only
Code Samples
EncodeAuthorizationHeader
MakeGetRequest
MakePostRequest
MakeGetFileRequest
MakeDeleteRequest
PowerShell

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

URL Format

Format: https://{BaseURL}/Programs/{ProgramId}/StatusList
 
Sample: https://{BaseURL}/Programs/A43FN6B/StatusList

Sample Response


<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>

Response XML Attributes

<Status> Attributes

StatusId – Unique identifier for the status
CustomId – optional, admin-provided unique identifier for the status
Name – Status name

Sample Code


// 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?