2

I am trying make a request query to Sage sdata web service to the following endpoints tradingActivites and receipts as nothing is obvious on these docs

I have this so far localhost:5493/sdata/accounts50/GCRM/-/tradingActivities?where=accountReference eq "1200" &format=json that gives me all the transactions of this account but I also need the information from receipts endpoint as well.

Is it better to do two curl requests or what would be the correct syntax for querying this type of web service in the URL. Thank you for reading this any help would be appreciated.

Manos Nikolaidis
  • 21,608
  • 12
  • 74
  • 82
Artful_dodger
  • 698
  • 2
  • 7
  • 26

1 Answers1

1

You would need to do two curl requests to get the data you need and then do whatever matching of data you need in PHP.

This is based off the information I have unless you can look through the docs and get a method that provides all the data you need.

Phil Cook
  • 2,025
  • 19
  • 25
  • In the Sdata 2.0 Specification it give an example of "include=orderLines,customer include=$children" but no examples of how to use the include statement in the GCRM contract – Artful_dodger Mar 12 '16 at 11:59
  • Phil to you have an example of two curl requests – Artful_dodger Mar 15 '16 at 20:24
  • trying to find someone that understands this statement "The second parameter, include, allows an SData consumer to request the payload includes related resources. Without this parameter, an SData query on a resource kind only returns the payload for the requested resource kind. It does not include the payload for related resources. The effect of this parameter is described in the Resource Linking and Embedding section." – Artful_dodger Mar 15 '16 at 21:17
  • I think the answer to my question may lie in this document http://sage.github.io/SData-2.0/pages/core/0605/ but insufficient info to be of any help – Artful_dodger Mar 15 '16 at 21:27
  • @Artful_dodger have you tried doing your tradingActivities query with an include of the receipts? `tradingActivities?where=accountReference eq "1200" &format=json&include=receipts` – Phil Cook Mar 16 '16 at 15:05
  • Hi Phil Cook yes Ihave tried a couple of variation of this would it help is I add the endpoints template? did you read the SData docs then? – Artful_dodger Mar 16 '16 at 20:07