cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple GET methods with same REST communication channel

Former Member
0 Kudos

I have a REST  --- PI --- ECC synchronous scenario. I am usiing GET method anad it's working fine.  The endpoint for my REST is this host:port/REST/DFT/Employee/<number>

The last is dynamic, they enter the particular employee number and we get details of the respective employee from ECC. If they want all emplpoyees then they use host:port/DFT/Employee/* and ths star will fetch all employee details.

Now the cllient want one more requirement to be included. They may give a date range also, datefrom and dateto and we need to get employee details for that peroiod. This time the GET method has different inputs. is it possible to do both in one interface?

or do I have to design a new interface with new endpoint ? They need GET method only

I can do this in POST as in POST they send a payload. in GET they are not sending any payload...

Can there be multiple GET operationds in onre interface

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member182412
Active Contributor
0 Kudos

Hi Midhun,

You can try create multiple dynamic optional attributes as per below blog.

Regards,

Praveen.

Former Member
0 Kudos

hi Praveen

I am using a url like this

host:port/REST/DFT/Employee/<number>


If I am to enter datefrom and dateto


then I have to modify it like that


host:port/REST/DFT/Employee/<number>/DateFrom/DateTo


So in this case they will not send any value for <number>


if there is no value in <number> how will I keep it blank

former_member182412
Active Contributor
0 Kudos

Hi Midhun,

You can defined optional attribute of you have PI 7.31 SP15 or PI 7.4 SP10.

Refer Alexander reply in below thread.

Regards,

Praveen.

manoj_khavatkopp
Active Contributor
0 Kudos

Hi Midhun,

Not sure of REST adapter never wokred on that , But yes it is possible to have multiple operation in one service interface .

Br,

Manoj

Former Member
0 Kudos

Hi manoj

I have also worked with mulitple operation in one single interface.

REST communication channel has specific endpoints. There are no options to use multiple endpoints.

former_member186851
Active Contributor
0 Kudos

Hello Midhun,

Why don't you try like below, Instead of different QOS try giving different endpoint. But am not sure how much it will work