Updating model objects using the REST API

You can use the REST API to update an existing model object using either of two methods.

You can use either a model object resource or the model object update service resource to update an existing model object, depending on whether you want to allow creation of new objects.

In either case, you must first describe the new object data using either JSON or XML format; the server automatically detects which format is used. If you need to specify a complex model object, it can be useful to first query the class metadata using the model object class metadata service. The results of this query will provide the correct attribute names for the object, which you can then use to specify the new data in XML or JSON format.

To use the REST API to update existing model objects, complete one of the following two methods:

  • Use the model object resource representing the existing object and the HTTP PUT method, passing the new object data in the body of the request.
    This resource is available only if the specified object already exists; if the object does not exist, the request fails. Use this method if you want to modify an existing object but do not want to add the object if it does not exist.
  • Use the model object update service and the HTTP PUT method, passing the new object data in the body of the request.
    This method updates the object with the new data; if the object does not already exist, this method creates it. Use this method if you want to make sure an object with the specified object data exists in the TADDM database, regardless of whether it already existed.