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

SubmitProject

Submits a given project. Requires write access to the project and its associated program.
 
HTTP verb: POST
Required inputs: ProgramId, ProjectId, FormId

URL Format

Format: https://{BaseURL}/Programs/{ProgramId}/Projects/{ProjectId}/Forms/{FormId}/Submit
 
Sample: https://{BaseURL}/Programs/1HF29X4P/Projects/YA6XD8U4QG/Forms/Q60TV2AF/Submit
 
Sample if a custom ID of e.g. “MyForm” has been set:
https://{BaseURL}/Programs/1HF29X4P/Projects/YA6XD8U4QG/Forms/MyForm/Submit
 

Sample Response


<ProjectSubmitResponse>
    <Project ProjectId="JC8SR659PV" ProgramId="1HF29X4P" ProjectNumber="TEST-00011" Status="Application in Process" StatusTimestamp="2014-10-24T16:27:51-07:00" LastChangeTimestamp="2014-10-24T16:27:34-07:00"/>
    <Url Value="http://testagency.powerclerk.com/Projects/ProjectList?ProgramId=1HF29X4P"/>
</ProjectSubmitResponse>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://service.powerclerk.com/api/v1/">
  <xs:element name="ProjectSubmitResponse">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="Project">
          <xs:complexType>
            <xs:simpleContent>
              <xs:extension base="xs:string">
                <xs:attribute type="xs:string" name="ProjectId" use="required"/>
                <xs:attribute type="xs:string" name="ProgramId" use="required"/>
                <xs:attribute type="xs:string" name="ProjectNumber" use="required"/>
                <xs:attribute type="xs:string" name="Status" use="required"/>
                <xs:attribute type="xs:dateTime" name="StatusTimestamp" use="required"/>
                <xs:attribute type="xs:dateTime" name="LastChangeTimestamp" use="required"/>
              </xs:extension>
            </xs:simpleContent>
          </xs:complexType>
        </xs:element>
        <xs:element name="Url">
          <xs:complexType>
            <xs:simpleContent>
              <xs:extension base="xs:string">
                <xs:attribute type="xs:anyURI" name="Value" use="required"/>
              </xs:extension>
            </xs:simpleContent>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
      <xs:attribute type="xs:float" name="SchemaVersion"/>
    </xs:complexType>
  </xs:element>
</xs:schema>

Response XML Attributes

<Project> Attributes

ProjectId – Unique identifier for the project
ProgramId – Unique identifier for the program
ProjectNumber – The project number. Projects are assigned a project number when they have been submitted.
Status – Name of the current status of the project
StatusTimestamp – Timestamp of when the project entered the current status. Converted to user’s local timezone.
LastChangeTimestamp – Timestamp of the last change made to the project. Converted to user’s local timezone.
 

<Url> Attributes

Value – The URL for this program’s project list

Sample Code


// Submit the given form for the given project.
// Returns the assigned project number, or null if there was an error and no project number was
// assigned.

public string SubmitProject(string programId, string projectId, string formId, string username, string password, string apiKey)
{
    string url = "/Programs/" + programId + "/Projects/" + projectId + "/Forms/" + formId +
"/Submit";
    XDocument xmlResponse = MakePostRequest(BaseUrl + url, null, username, password, apiKey);
	
    XNamespace ns = "http://service.powerclerk.com/api/v1/";
    List<XElement> projectElements = xmlResponse.Descendants(ns + "Project").ToList();
	
    // Check that the response was successful. In the case of success, the call will return a
    // single Project element that indicates the project’s new status.
    if (projectElements.Count == 1)
    {
        string projectNumber = projectElements[0].Attribute("ProjectNumber").Value;
        return projectNumber;
    }
    return null;
}

function submitProject(programId, projectId, formId) {
    // Use $.ajax jQuery method to execute the API call
    $.ajax({
        type: "POST",
        url: "https://{BaseURL}/Programs/" + programId + "/Projects/" + projectId + "/Forms/" + formId + "/Submit",
        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 MakePostRequest sample code.