Create a Reference
View the full schema here.
In order to create a reference you are required to provide (a minimum of) three pieces of information:
- The Ardoq OID of the source component.
- The Ardoq OID of the target component.
- The type identifier that the reference should have.
Once you know the source component OID you can get the context for the workspace that the component belongs to. The response contains information about the available types of reference including mappings between human readable names and internal ids.
Note
Whenever working with references, remember that each reference belongs to the same workspace as the source component.
In the following example we will create a reference between two components: c253c98231776d0c8a54879e
and d893c982317afd0c8a54875f
. We want the type of the reference to be 33
.
curl \
--request POST \
--header "Authorization: Bearer ${ARDOQ_API_TOKEN}" \
--header "X-org: ${ARDOQ_ORG_LABEL}" \
--header "Content-Type: application/json" \
--data '{"source":"c253c98231776d0c8a54879e","target":"d893c982317afd0c8a54875f","type":33}' \
--fail-with-body \
"${ARDOQ_API_HOST-"https://app.ardoq.com"}/api/v2/references"