Exploring basic rules
Let's try exploring the claimRights endpoint:
Just invoking it reveals empty set.
Now let's attempt creating some claimRights:
Error states that the only accepted Content-Type is application/json.
Let's satisfy the Content-type requirement:
Error states that no data has been found in JSON body.
.. index:: claimRight
Let's create claim right with the minimal (only required) data set:
Success! Now we can see that new object was created. Response code is 201 and Location response header reports the location of the created object. The body of response reveals the information about the created claim right: its internal id (that matches the Location segment), its official assetID and dateModified datestamp stating the moment in time when it was last modified. Pay attention to the assetType. Note that the object is created with pending status.
Let's access the URL of the created object (the Location header of the response):
We can see the same response we got after creating asset.
Let's see what listing of claim rights reveals us:
We do see the internal id of the claim right and its dateModified datestamp.
The previous claim right contained only required fields. Let's try creating another one with more data (status created):
And again we have 201 Created response code, Location header and body with extra id, assetID, and dateModified properties.
Let's check what asset registry contains:
And indeed we have 2 objects now.
Modifying Claim Right
Let's update claim right description:
We see the added properies have merged with existing data. Additionally, the dateModified property was updated to reflect the last modification datestamp.
Checking the listing again reflects the new modification date:
Deleting Claim Right
Let's delete it:
Integration with lots
Assume we attached assets to lot:
Let`s change lot status to recomposed.
When bot finds such a lot, it turns status of the assets being attached to that lot to pending.