Forum

Welcome to ProjeQtOr new Forum. We migrated old forum to the new website.
You will find all your posts here, with your usual account.
Just one point : you’ll have to reinitialize your password. Use “Lost password” feature.

Is there a way to g...
 
Notifications
Clear all

Is there a way to get linked objects using the REST API ?

3 Posts
2 Users
0 Reactions
1,836 Views
(@nicolasnasdron-be)
Posts: 4
Active Member
Topic starter
 
[#7681]

For example, we have a ticket (id # 16) that is linked to an Equipment (id # 1).
If we make a GET request to obtain the ticket ( http://myserver/projeqtor/api/Ticket/16 ), we obtain a JSON record containing all the Ticket's fields, but not the linked objects...

By the way, the Projeqtor API is a great tool!

Thanks for your help,
Nicolas.


 
Posted : 11 Aug 2021 2H40
(@nicolasnasdron-be)
Posts: 4
Active Member
Topic starter
 

OK, the answer was easy: we just have to use the class object "Link".

Exemple: to get all the objects linked to the ticket # 16:

http://myserver/projeqtor/api/Link/search/ref2Type ='Ticket'/ref2Id=16

Then we should extract the ref1Id's from the result...


 
Posted : 11 Aug 2021 3H06
(@babynus)
Posts: 14952
Member Admin
 

In addition, pay attention that you can also have links with ref1Type='Ticket'/ref1Id=16 , then linked element is on ref2Type/ref2id
Rule is that Ref1 is the "smallest" for Class#Id


 
Posted : 12 Aug 2021 19H28
Share:

Scroll to Top