Web API Update operations fall into two categories:
Insert: The allows the user to insert new data into the database. As some resources, such as Property and Open House can have children, a deep insert ability allows for the addition of parent and children in one call. For example a Property resource can have Media, PowerProduction, PropertyGreen, PropertyUnits, and OpenHouse resource as children.
Change: Also refered to as a "Patch" operation, this allows the user to change one or more fields of an existing resource.
This diagram illustrates a typical Listing Input work flow:
sequenceDiagram
LIM ->> Identity: 1. Authenticate
activate LIM
Identity -->> LIM: 2. Response with token
LIM ->> MediaAPI: 3. POST Only Binaries
MediaAPI -->> LIM: 4. JSON response with location and Id
LIM ->> WebAPI: 5. POST/PATCH Entity
WebAPI ->> WebAPI: 6. Validate
WebAPI ->> SQL: 7. Commit to database
WebAPI -->> LIM: 8. Respond with Entity or Errors
deactivate LIM
Sequence Notes
- Authentication - Implicit or Resource owner password is required to POST/PATCH. It is needed to know the identity of the member using the LIM in order to properly validate the transaction.
- An out-of-band operation is required to post media binaries to a service. On success this service will respond with the required attributes that include the location uri and media key to post the media entities to the web api along with the listing entity.
- Listing deep insert is supported. Currently, deep update is NOT supported by OData 4.0 libraries.
- Validation - Embedded in the api we have primative "Who Can Edit" logic based on the resource owner's claims. Business Rules can be downloaded and examined
Participant Descriptions
LIM - Client application such as CloudMLX, Broker back office, etc...
Identity - Identity service: Getting Started
MediaAPI
- Media binary upload service: http://uploads.crmls.org/api/mediaupload
- Testing MediaAPI - http://uploads.crmls.org - using the same clientId and secret usd for the web api
- Posting to this endpoint is in a multipart/form-data type of post
WebAPI - OData service: https://h.api.crmls.org
SQL - Database server