Create a new relation
This article shows how to use the ADOXX API to create new relations.
The Java snippet below will create a new relation in the repository between a source object and a target object.
note
The Java snippet below uses Basic Authentication.
Replace the values in angle brackets with values that fit your setup, e.g. instead of <HOST> use the host at which you access your ADOXX instance.
Click to view the code!
Loading code...
The result should look similar to the following:
Status Code: 201
Result:
{
  "locale": "en",
  "item": {
    "rest_links": [ ... ],
    "id": " ... ",
    "name": "MyArtifact",
    "type": "Artifact",
    "artefactType": " ... ",
    "metaName": "C_ARTIFACT",
    "link": { ... },
    "icon": { ... },
    "attributes": [ ... ],
    "relations": [ ... ]
  }
}
Status Code: 201
Result: 
{
  "locale":"en",
  "rest_links":[ ... ],
  "from":
  {
    "rest_links":[ ... ],
    "id":" ... ",
    "metaName":"C_ARTIFACT",
    "name":"MyArtifact",
    "type":"Artifact",
    "artefactType":"REPOSITORY_OBJECT"
  },
  "to":
  {
    "rest_links":[ ... ],
    "id":" ... ",
    "metaName":"C_ARTIFACT",
    "name":"MyTargetArtifact",
    "type":"Artifact",
    "artefactType":"REPOSITORY_OBJECT"
  },
  "attributes":[ ... ]
}