logo
Use this method to retrieve a single document from the extension document store.

Field
Type
Required
Description
method
String
Yes
"extensionGetDoc"
app_id
String
Conditional
The app the document belongs to. If omitted, the API's own chat id is used.
doc_type
String
Yes
Category of the document.
doc_id
String
Yes
Identifier of the document to retrieve.
ref
String
Optional
Correlation id, echoed in the response.

Response

extensionGetDocResponse

Field
Type
Returned
Description
method
String
Yes
"extensionGetDocResponse"
doc
String
Conditional
The stored document body. Absent if no document matched.
doc_id
String
Yes
Echoed from the request.
doc_type
String
Yes
Echoed from the request.
app_id
String
Yes
Echoed from the request.
ref
String
Optional
Echoed from the request.

SDK Mapping β€” extensionGetDoc

SDK
Response Callback
Java
onExtensionDocResponse(ExtensionDocResponse response) β€” type is get
JavaScript
onExtensionDocResponse(response) β€” type is get
Python
on_extension_doc_response(self, response) β€” type is get

Example

Request

json
{ "method": "extensionGetDoc", "app_id": "90090684293000559", "doc_type": "cart", "doc_id": "user_9001", "ref": "111111149" }

Response

json
{ "method": "extensionGetDocResponse", "doc": "{\"items\":[{\"sku\":\"A12\",\"qty\":2}]}", "doc_id": "user_9001", "doc_type": "cart", "app_id": "90090684293000559", "ref": "111111149" }