Query does not return data
App Development4 posts324 views8 likesLast activity Jul 2020
MG
mgnesinOP
Jul 2020Please help me adjust Streaming API query below to return data:
API:
wss://api.projectdabl.com:443/data/xdf1p1lu9vhs9qxg/v1/stream/fetch
Query:
[{"templateId":"2ef7cea81f7368d1a11a027a44cd56e66973d56f5d17c363f7876a00f92848e3:Main:Application", "key": {"lender":"ledger-party-fdf6256b-bae9-47f2-820e-7698e4b88a55"}},
{"templateId":"2ef7cea81f7368d1a11a027a44cd56e66973d56f5d17c363f7876a00f92848e3:Main:ApprovedApplication",key: {"lender":"ledger-party-fdf6256b-bae9-47f2-820e-7698e4b88a55"}},
{"templateId":"2ef7cea81f7368d1a11a027a44cd56e66973d56f5d17c363f7876a00f92848e3:Main:Payment",key: {"lender":"ledger-party-fdf6256b-bae9-47f2-820e-7698e4b88a55"}},
{"templateId":"2ef7cea81f7368d1a11a027a44cd56e66973d56f5d17c363f7876a00f92848e3:Main:PaymentRequest",key: {"lender":"ledger-party-fdf6256b-bae9-47f2-820e-7698e4b88a55"}}]
Currently response is:
type: 'message',
data: '{"events":[],"offset":"0000000000000016"}
LI
Li_Ma
Jul 2020Hi @mgnesin
I suggest troubleshooting by the following steps:
- Making sure the PackageId:
2ef7cea81f7368d1a11a027a44cd56e66973d56f5d17c363f7876a00f92848e3in the query body, align with your targeted dar. And dar is correctly deployed to the ledger.
The template name may seem the same, but the underlying Model could be referencing a different dar package. One easy way to confirm is to deploy your latest dar and try to create and query on a fresh ledger - Making sure a
GET /v1/queryACS call does show some data by the key criteria you provided above. - Making sure the token you passed in websocket subprotocol belongs to a
Partythat has permission to see the data you are query from, you can also confirm that by using the token to callGET /v1/query
MG
mgnesin
Jul 2020Thank you! I am getting the data back now.