I have the following entity:
<car>
<carID>7</carID>
<...>...</...>
<externalCarID>23890212</externalCarID>
</car>
The problem is now that carID
and externalCarID
are both independent primary keys that are used by/for different systems and it should be possible for API clients to access a car
entity with both the carID
xor the externalCarID
.
Both keys are ints and they do not use disjoint sets:
carID(7) != externalCarID(7)
I have thought of the following solutions:
- Access it with
/restapi/car/7
and/restapi/externalcar/23890212
- Use parameters e.g. like
/restapi/car/7?type=regular
and/restapi/car/23890212?type=ext
- Send the information somewhere in the header - but where?
Some tips how to handle this or feedback on my solutions, preferably with the reference to REST / HTTP specs, would be great!
Background about the primary keys:
Lets say our invoice systems needs the carID
and our parent company controlling system needs the externalCarID
. I do not like that at all, but its a running system and there is no way for me to change it right now.