Solved

Http Get - UserFieldChar

  • 20 July 2022
  • 2 replies
  • 153 views

Userlevel 4
Badge +12

I am trying to pull an event’s itemB’s userChar fields using Rest and note that the uri below only presents the API with the basic/ standard information set in the connected items.

http://<Server>:<Port>/assystREST/v2/events/10183439?fields=affectedUser[],itemA[],itemB[]

I have tried explicitly calling the field in the web request uri with no luck.

?fields=affectedUser[],itemA[],itemB[userFieldChar12]

This information appears if we run a second pull using the item id extracted from the event, but that seems a bit wasteful and we are able to pass it in from the AP as a parameter if necessary. But I was wondering if anyone was already doing this and whether you might be able to give me some pointers?

 

Thanks in advance.

icon

Best answer by Alan Macfarlane 20 July 2022, 12:35

View original

2 replies

Userlevel 2
Badge +5

To pull just the itemB information for an event the syntax should be:

 

GET http://{server}:{port}/assystREST/v2/events/{id}?fields=[itemB[*]]

 

This should return the itemB fields with values for the event. 

 

To get a specific property of itemB from for an event:

 

GET http://{server}:{port}/assystREST/v2/events/{id}?fields=[itemB[userFieldChar1]]

 

 

 

Userlevel 1
Badge +1

To get the fields from the event AND the itemB-fields use:

GET http://{server}:{port}/assystREST/v2/events/{id}?fields=*,[itemB[*]]

Reply