diff --git a/_includes/use-cases/use-case-consumption-accept-incoming-request.md b/_includes/use-cases/use-case-consumption-accept-incoming-request.md index e69de29bb..e77b3ea4d 100644 --- a/_includes/use-cases/use-case-consumption-accept-incoming-request.md +++ b/_includes/use-cases/use-case-consumption-accept-incoming-request.md @@ -0,0 +1,56 @@ +Attempts to accept an incomming request by it's Id. + +The items array indicate the decision made for each individual request item in the request. + +## Parameters + +```js +{ + requestId: string, + items: (DecideRequestItemParametersJSON | DecideRequestItemGroupParametersJSON)[] +} +``` + +## Return Value + +```ts +{ + id: string, + isOwn: boolean, + peer: string, + createdAt: string, + status: [LocalRequestStatus](http://www.google.com), + content: RequestJSON; + source?: LocalRequestSourceDTO; + response?: LocalResponseDTO; +} + +enum LocalRequestStatus { + Draft = "Draft", + Open = "Open", + DecisionRequired = "DecisionRequired", + ManualDecisionRequired = "ManualDecisionRequired", + Decided = "Decided", + Completed = "Completed", + Expired = "Expired" +} +``` +
+ 
+  gmarciani
+ 
+
+## Example + + +```js +const acceptResponse = await runtime.consumptionServices.incommingRequests.accept( + { + requestId: "REQ_ID", + items: [{ accept: true }] + } +); +if (acceptResponse.isError) { + throw new Error(acceptResponse.error); +} +```