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
Common Usage Scenarios
Below are a few common PowerClerk processes that we anticipate customers will complete using the API. You may find it useful
to run through the scenarios outlined here as a way to familiarize yourself with the API’s capabilities. The examples here
use the Clean Power Research Test Agency, but can be adapted to other agencies.
to run through the scenarios outlined here as a way to familiarize yourself with the API’s capabilities. The examples here
use the Clean Power Research Test Agency, but can be adapted to other agencies.
Create and Submit a Project
This example demonstrates how to use API calls to create a new project, populate one of the project’s forms with data and attachments, and then submit the form.
- Call GetPrograms with AgencyId = FN7635MW. In the response, note the ProgramId for the “Test Net Metering Program”.
Sample call with CPR Test AgencyId = FN763MW:https://{BaseURL}/Programs?Agency=FN7635MW
- Call CreateNewProject with the ProgramId you just noted. In the response, note the ProjectId of the new project and the FormId for “Net Metering Application – TEST”.
Sample call using ProgramId = 1HF29X4P:https://{BaseURL}/Programs/1HF29X4P/NewProject
- Call GetFormSchema with the FormId you just noted. Use the response to determine which DataFields and Attachments are required for this form, and note the corresponding DataFieldId and AttachmentId values.
Sample call using ProgramId = 1HF29X4P and FormId = Q60TV2AF:https://{BaseURL}/Programs/1HF29X4P/Forms/Q60TV2AF/Schema
- Create an XML request payload to set data values for the required DataFields, using the DataFieldId values you just noted.
- Call SetProjectData with your request payload, using the ProjectId of the project you created earlier.
Sample call using ProgramId = 1HF29X4P, ProjectId = AK6ZP5H9, FormId = Q60TV2AF:
https://{BaseURL}/Programs/1HF29X4P/Projects/AK6ZP5H9/Forms/Q60TV2AF/Data
- Call SetProjectAttachment with the file you’d like to attach as the request payload. Use the AttachmentId you noted earlier.
Sample call using ProgramId = 1HF29X4P, ProjectId = AK6ZP5H9, FormId = Q60TV2AF, AttachmentId = 3QX3VQ18:
https://{BaseURL}/Programs/1HF29X4P/Projects/AK6ZP5H9/Forms/Q60TV2AF/Attachments/3QX3VQ18/Upload
- Call GetProjectData to view the DataField and Attachment values you’ve just set. Note the CanSubmit attribute in the Project element, which will be set to true if you’ve satisfied all the requirements to submit this form.
Sample call using ProgramId = 1HF29X4P, ProjectId = AK6ZP5H9, FormId = Q60TV2AF:
https://{BaseURL}/Programs/1HF29X4P/Projects/AK6ZP5H9/Forms/Q60TV2AF/Data
- If you’ve satisfied all the data requirements, call SubmitProject to submit this form for this project.
Sample call using ProgramId = 1HF29X4P, ProjectId = AK6ZP5H9, FormId = Q60TV2AF:
https://{BaseURL}/Programs/1HF29X4P/Projects/AK6ZP5H9/Forms/Q60TV2AF/Submit
- Use the SubmitProject XML response to verify that your form was submitted successfully and assigned a project number.
Add/Change Data in an Existing Project
This example demonstrates how to use API calls to add and edit data in an existing project.
- In the PowerClerk web interface, create a new project and add data to the Net Metering Application form. Save your changes.
- Call GetPrograms with AgencyId = FN7635MW. Take note of the ProgramId for the Test Net Metering Program.
Sample call with CPR Test AgencyId = FN763MW:
https://{BaseURL}/Programs?Agency=FN7635MW
- Call GetProjects with the ProgramId you just noted. In the XML response, find the project you just created and take note of its ProjectId.
Sample call with ProgramId = 1HF29X4P:
https://{BaseURL}/Programs/1HF29X4P/Projects
- Call GetProjectData with your ProjectId. Verify that the data you added in the web UI appears in the response. Take note of the DataFieldId values for the data fields you’d like to edit.
Sample call using ProgramId = 1HF29X4P, ProjectId = AK6ZP5H9, FormId = Q60TV2AF:
https://{BaseURL}/Programs/1HF29X4P/Projects/AK6ZP5H9/Forms/Q60TV2AF/Data
- Create an XML request payload to set or change the data in the Net Metering Application form. Use the DataFieldId values you noted earlier.
- Call SetProjectData with your request payload. Look at the response and verify that the data changes you made have been saved.
Sample call using ProgramId = 1HF29X4P, ProjectId = AK6ZP5H9, FormId = Q60TV2AF:
https://{BaseURL}/Programs/1HF29X4P/Projects/AK6ZP5H9/Forms/Q60TV2AF/Data
- In the web UI, open your project and verify that the data values have been changed by your API call.
Daily Polling for Project Changes
This example demonstrates how daily calls to the GetProject method can be used to keep track of projects that have been changed in the past 24 hours.
- Call GetPrograms with AgencyId = FN7635MW. In the response, note the ProgramId for the “Test Net Metering Program”.
Sample call with CPR Test AgencyId = FN763MW:
https://{BaseURL}/Programs?Agency=FN7635MW
- Call GetProjects with the ProgramId you just noted. In the response, find the ProjectsResponse element and note the value of the RequestTimestamp.
Sample call with ProgramId = 1HF29X4P:
https://{BaseURL}/Programs/1HF29X4P/Projects
- After a day, make another call to GetProjects. This time, include the “changed_since” parameter. Set the parameter value to the RequestTimestamp from the previous call. This will retrieve all the projects that have been changed since the previous call to GetProjects.
In the response, note the value of RequestTimestamp.
Sample call with ProgramId = 1HF29X4P and “changed_since” parameter:
https://{BaseURL}/Programs/1HF29X4P?changed_since=2014-10-22T23:00:28.6263508%2B00:00
- On each subsequent day, make a call to GetProjects, using the value of the previous day’s RequestTimestamp as the value for the “changed_since” parameter. This will ensure continuous monitoring.
What’s Next?