Skip to content
Discussions/App Development/Query does not return dataForum ↗

Query does not return data

App Development4 posts324 views8 likesLast activity Jul 2020
MG
mgnesinOP
Jul 2020

Please 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 2020

Hi @mgnesin

I suggest troubleshooting by the following steps:

  1. Making sure the PackageId: 2ef7cea81f7368d1a11a027a44cd56e66973d56f5d17c363f7876a00f92848e3 in 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
  2. Making sure a GET /v1/query ACS call does show some data by the key criteria you provided above.
  3. Making sure the token you passed in websocket subprotocol belongs to a Party that has permission to see the data you are query from, you can also confirm that by using the token to call GET /v1/query
MG
mgnesin
Jul 2020

Thank you! I am getting the data back now.

AN
andreolf
Jul 2020

BTW Welcome to the forum @mgnesin @Li_Ma! Great to see this!

← Back to Discussions