I would to know if it is possible to have a rest call with this format:
/{id1,id2}
So we end up with a pair of values id1 and id2. I know a hacky way to do it but I am asking if there is a official way.
Note quite clear what you are asking.
You shouldn't have a URI with that spelling, because '{' and '}' are not allowed in segments; see RFC 3986, Appendix A
But a URI Template with that spelling should be fine. The trick is that you will need at least level 3 template support
Here's a demo based on Handy-URI-Templates
REST, of course, doesn't care what spelling you use for your identifiers; as far as REST is concerned, an identifier is opaque; any information encoded into the identifier is done at the server's discretion and is reserved for its own use.
I managed to do this by having the path like this: /{src},{dst}
You may want to investigate matrix parameters.