Api/ProcFormAdd

From RPM Wiki

Table of contents

Summary

API: Add a form. Similar to Api/ProcFormEdit.

  • Not used for directly adding/editing actions, participants, notes, or files. Those will be separate API calls.

Request

You need to identify the process and then include all the optional form data

  • The form number is optional. If it is omitted a number is automatically generated (recommended).
  • The status level is optional. If it is omitted the default status level is used (recommended).
  • The owner is optional. If it is omitted, the API user is the owner. The owner will be added as a participant.
  • Fields are optional. The API ignores required field restrictions.
  • Any error causes the whole request to fail
  • Field value changes will fire any applicable status triggers
  • Status level changes will fire any applicable global actions or approvals

By process name

{
  "Key":"{api key}",
  "Process":"{process name}",
  "Form": {
    "Number":"{form number}",
    "Owner":"{staff user name}",
    "Status":"{status level}",
    "Fields": [
      {
        "Field":"(field name)",
        "Value":"{field value}"
      },
      { repeat as needed }
    ]
  }
}

By process ID

{
  "Key":"{api key}",
  "ProcessID":"{process ID}",
  "Form": {
    "Number":"{form number}",
    "Owner":"{staff user name}",
    "Status":"{status level}",
    "Fields": [
      {
        "Field":"(field name)",
        "Value":"{field value}"
      },
      { repeat as needed }
    ]
  }
}

Examples

http://demo.rpmsoftware.com/rpm/Api.svc/ProcFormAdd

The minimal request would be just a process. This would create a blank form with the default status level, automatic number, and the API user as the owner.

{
  "Key":"abc123def456",
  "Process":"Order"
}

Of course it's better to actually include some field values

{
  "Key":"abc123def456",
  "ProcessID":"12"
  "Form": {
    "Owner":"Bob Jones",
    "Fields": [
      {
        "Field":"New order?",
        "Value":"Yes"
      },
      {
        "Field":"Order date",
        "Value":"Jul 2, 2009"
      },
      {
        "Field":"Estimated MRC",
        "Value":13.5
      }
    ]
  }
}

Response

Use the response from Api/ProcForm

Errors

  • "Process not found"
  • "Permission denied"
  • "Status not found"
  • "Owner not found"
  • "Owner permission denied"

Details

  • Form history will show the new "API" method
  • Everything that happens with a UI start will happen here including triggers, email notifications, global actions, etc.
    • In the next version we'll provide API request commands to control this.

Future

Specific error reports including

  • "Form number error"
  • "Field ID error"
  • "Field value error"

History

  • This page was last modified 21:44, 23 Nov 2010.
  • This page has been accessed 2054 times.