0

I'd like to make a call to a query (SiteServices) from another site. I've set a "Read" permission on the query for "Anonymous". But, when I go to the URL "../DesktopModules/2sxc/API/app-query/SiteServices" I get an error that no module info was supplied.

Is it possible to read a query's data from outside of DNN? The query doesn't use any module information - it gives everything for a given content type.

Thanks,

Mike

Mike
  • 107
  • 7

1 Answers1

0

The query must always know what app it is for. Normally this information is provided through the module ID. When you're using it anonymous, you need to add the app-name.

.../2sxc/api/app-query/MyAppName/SiteServices

is the syntax you're looking for.

iJungleBoy
  • 5,325
  • 1
  • 9
  • 21
  • Thanks Daniel... I guess I'm still running into some trouble. I'm getting this message: The 'ObjectContent`1' type failed to serialize the response body for content type 'application/xml; charset=utf-8'. The stream in the query works fine when I just test the query... but it's getting that result when I call it from the API... – Mike Nov 16 '16 at 16:18
  • might you are using a data-source in your query, which requires a module context - specifically the module-data-source? – iJungleBoy Nov 22 '16 at 13:19
  • Thanks - I don't think so... I have ICache -> PublishingFilter -> EntityTypeFilter -> CacheAllStreams -> (Output) – Mike Nov 22 '16 at 18:13
  • Ok, so I think my original answer was correct, and your new error "failed to serialize" is because your js accidentally requested an XML format, while the query api currently only does json. so adjust your request headers and you're good to go. – iJungleBoy Nov 29 '16 at 08:27