Api/ProcFormEdit

From RPM Wiki

Table of contents

Summary

API: Update a form. Similar to Api/ProcFormAdd.

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

Request

You need to identify the form and then include the optional information to update.

  • Either the form ID or form number + process is needed.
  • Any field not included will be left alone.
  • Updating a field with a blank value will clear out the field in the form.
  • If the new owner is not already a participant, they will be added
  • 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 form ID

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

By form number + 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 form number + 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/ProcFormEdit

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

Response

{"ProcFormEditResult":
  {
    {ProcForm result - See Api/ProcForm}
  }
}

Errors

  • "Process not found"
  • "Form 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 edit 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 20:37, 28 Sep 2009.
  • This page has been accessed 2136 times.