Scoota P
Scoota P

Reputation: 2551

Restful service naming convention for service

I have a service connecting to an enterprise service which I have no control over. The service requires I make a call to it to initiate a ping to a device and then make subsequent calls to it to get the status. After 20 or so seconds I will get the status back.

I have been thinking of a rest pattern and just getting stuck on the fact that it is not truly restful Id like to reach out for feedback and get some opinions. I could just do a normal get /device/status and hit it over and over again? Or i could break up the call into /device/ping and /device/status or something like that. Any ideas are appreciated! Thanks

Upvotes: 0

Views: 88

Answers (2)

Lokesh Gupta
Lokesh Gupta

Reputation: 472

I will suggest to return the a JMS queue URL in location header in API response. Usually, in device management applications, separate JMS server is deployed. Make use of it - if it's there.

Take a hint from here.

.

Upvotes: 0

ritesh.garg
ritesh.garg

Reputation: 3943

For status, REST standards would suggest a format of '/device/{deviceId}/status'. But if the enterprise service you are connecting to does not support multiple devices; you could go for '/device/status' with 'GET' http verb.

You could use '/device/status' with 'HEAD' http verb as an exposure for the ping call

Upvotes: 1

Related Questions