From 5914bd77e523f2fc5625a2133b471c5040b077c0 Mon Sep 17 00:00:00 2001 From: Britta Stallknecht <146106656+britsta@users.noreply.github.com> Date: Wed, 5 Mar 2025 14:09:13 +0100 Subject: [PATCH] Use `templateId` instead of `template` for Relationships (#308) * feat: use templateId instead of template within Query Relationships use case * feat: apply new query parameter of Query Relationships use case to scenarios --- _docs_integrate/establish-relationships.md | 4 ++-- _docs_integrate/integration-example.md | 2 +- _docs_integrate/requests-via-relationshiptemplates.md | 6 ++---- _docs_use-cases/use-case-transport-query-relationships.md | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/_docs_integrate/establish-relationships.md b/_docs_integrate/establish-relationships.md index 85eae0d31..eb8193908 100644 --- a/_docs_integrate/establish-relationships.md +++ b/_docs_integrate/establish-relationships.md @@ -181,7 +181,7 @@ The [Request Module]({% link _docs_explore/61-runtime.md %}#request-module) enab Accepting the Request is done by following the instructions of the [Accept incoming Request]({% link _docs_use-cases/use-case-consumption-accept-incoming-request.md %}) use case and providing the `id` of the Request as well as an appropriate input to build the [Response]({% link _docs_integrate/data-model-overview.md %}#response) of the initiator to the Request. In case of success, the `status` of the LocalRequest will change from `"ManualDecisionRequired"` to `"Decided"` and the `consumption.incomingRequestStatusChanged` [Connector event]({% link _docs_integrate/connector-events.md %}) will be triggered. The Response of the initiator to the Request will be contained within the `response.content` property of the LocalRequest. By accepting the Request, a data object of type [Relationship]({% link _docs_integrate/data-model-overview.md %}#relationship) with `"Pending"` as `status` is created and the `transport.relationshipChanged` [Connector event]({% link _docs_integrate/connector-events.md %}) is triggered. The Relationship's `creationContent.response` property contains the initiator's Response to the Request. -It is not necessary, but you can query this Relationship by proceeding as described in the [Query Relationships]({% link _docs_use-cases/use-case-transport-query-relationships.md %}) use case documentation, using the query parameter `template.id=`. If you decide to do this, you will receive a `result` as response from which you can read the `id` of the Relationship. +It is not necessary, but you can query this Relationship by proceeding as described in the [Query Relationships]({% link _docs_use-cases/use-case-transport-query-relationships.md %}) use case documentation, using the query parameter `templateId=`. If you decide to do this, you will receive a `result` as response from which you can read the `id` of the Relationship. {: .notice--info} Note that it is of course also possible to reject the incoming Request, if the initiator does not wish to establish an active Relationship to the templator under the given conditions. In order to do this, make use of the documentation of the [Reject incoming Request]({% link _docs_use-cases/use-case-consumption-reject-incoming-request.md %}) use case. More detailed information about how to [reject]({% link _docs_integrate/requests-via-relationshiptemplates.md %}#reject) as well as how to [accept]({% link _docs_integrate/requests-via-relationshiptemplates.md %}#accept) an incoming Request can also be found in the [Requests via RelationshipTemplates]({% link _docs_integrate/requests-via-relationshiptemplates.md %}) guide. @@ -235,7 +235,7 @@ After the initiator has initiated the Relationship, the Integrator of the templa ### Receive the Pending Relationship -The templator must first [synchronize the updates of the Backbone]({% link _docs_use-cases/use-case-transport-synchronize-updates-of-backbone.md %}) in order to receive the data object of type [Relationship]({% link _docs_integrate/data-model-overview.md %}#relationship) with `"Pending"` as `status` previously created by the initiator. The synchronization causes the `transport.relationshipChanged` [Connector event]({% link _docs_integrate/connector-events.md %}) to be triggered. To view the created Relationship, proceed as described in the [Query Relationships]({% link _docs_use-cases/use-case-transport-query-relationships.md %}) use case documentation and specify `` as the value for the `template.id` query parameter. In particular, the `id` of the Relationship can be read from the `result`. +The templator must first [synchronize the updates of the Backbone]({% link _docs_use-cases/use-case-transport-synchronize-updates-of-backbone.md %}) in order to receive the data object of type [Relationship]({% link _docs_integrate/data-model-overview.md %}#relationship) with `"Pending"` as `status` previously created by the initiator. The synchronization causes the `transport.relationshipChanged` [Connector event]({% link _docs_integrate/connector-events.md %}) to be triggered. To view the created Relationship, proceed as described in the [Query Relationships]({% link _docs_use-cases/use-case-transport-query-relationships.md %}) use case documentation and specify `` as the value for the `templateId` query parameter. In particular, the `id` of the Relationship can be read from the `result`. {% include copy-notice description="Read the `id` of the Relationship from the `result` for the next step." %} diff --git a/_docs_integrate/integration-example.md b/_docs_integrate/integration-example.md index 32eb2d389..1619726bf 100644 --- a/_docs_integrate/integration-example.md +++ b/_docs_integrate/integration-example.md @@ -204,7 +204,7 @@ To do so, we [synchronize updates of the Backbone]({% link _docs_use-cases/use-c {% include rapidoc api_route_regex="^post /api/v2/Account/Sync$" %} The synchronization causes the `transport.relationshipChanged` [Connector event]({% link _docs_integrate/connector-events.md %}) to be triggered, which should be listened to in order to get the Relationship in status `Pending`. -We can also [get the Relationship]({% link _docs_use-cases/use-case-transport-query-relationships.md %}) via `GET /api/v2/Relationships`. Should you be repeating this tutorial, you could e.g. filter by the `id` of the RelationshipTemplate from earlier via `GET /api/v2/Relationships?template.id=` if you use a different RelationshipTemplate. +We can also [get the Relationship]({% link _docs_use-cases/use-case-transport-query-relationships.md %}) via `GET /api/v2/Relationships`. Should you be repeating this tutorial, you could e.g. filter by the `id` of the RelationshipTemplate from earlier via `GET /api/v2/Relationships?templateId=` if you use a different RelationshipTemplate. {% include rapidoc api_route_regex="^get /api/v2/Relationships$" %} diff --git a/_docs_integrate/requests-via-relationshiptemplates.md b/_docs_integrate/requests-via-relationshiptemplates.md index 4138aff03..d33a3b773 100644 --- a/_docs_integrate/requests-via-relationshiptemplates.md +++ b/_docs_integrate/requests-via-relationshiptemplates.md @@ -209,7 +209,7 @@ The Sender, then, can fetch it by [synchronizing the updates of the Backbone]({% However, if there is no active Relationship between the Connectors yet, a Relationship will be created, which has the `status` `"Pending"` for now. Its creation content is of type [RelationshipCreationContent]({% link _docs_integrate/data-model-overview.md %}#relationshipcreationcontent) and contains the Response to the Request. This Relationship is sent back to the Sender via a Message. -Then, the Request is set to `status` `"Completed"` and you can [query the Relationship]({% link _docs_use-cases/use-case-transport-query-relationships.md %}) using the query parameter `template.id=`. +Then, the Request is set to `status` `"Completed"` and you can [query the Relationship]({% link _docs_use-cases/use-case-transport-query-relationships.md %}) using the query parameter `templateId=`. As long as the Relationship is `"Pending"`, no new Request is created by [loading the RelationshipTemplate](#receive-the-request-by-loading-the-relationshiptemplate). The Sender can fetch the Relationship by [synchronizing the updates of the Backbone]({% link _docs_use-cases/use-case-transport-synchronize-updates-of-backbone.md %}). @@ -218,9 +218,7 @@ The new Relationship looks as follows: ```jsonc { "id": "REL...", - "template": { - // ... - }, + "templateId": "RLT...", "status": "Pending", "peer": "did:e:...", "creationContent": { diff --git a/_docs_use-cases/use-case-transport-query-relationships.md b/_docs_use-cases/use-case-transport-query-relationships.md index 4764a7431..43c234301 100644 --- a/_docs_use-cases/use-case-transport-query-relationships.md +++ b/_docs_use-cases/use-case-transport-query-relationships.md @@ -48,7 +48,7 @@ This use case queries [Relationships]({% link _docs_integrate/data-model-overvie - `peer` is the enmeshed address of the peer. - `status` is the status of the Relationship. -- `template.id` is the id of the [RelationshipTemplate]({% link _docs_integrate/data-model-overview.md %}#relationshiptemplate) that was used to initiate the Relationship. +- `templateId` is the `id` of the [RelationshipTemplate]({% link _docs_integrate/data-model-overview.md %}#relationshiptemplate) that was used to initiate the Relationship. ## On Success