-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add System ID to /characters/{character_id}/contracts/ #1213
Comments
Given ESI's past nature of reducing redundant data, I'm not so sure this will be approved.
Is this really a problem? AFAIK there can only be two "types" of origin, a structure or a station, which you can easily deduce based on the size of the ID. I.e. something like: path = location_id > 1_000_000_000_000 ?
"/universe/structures/#{location_id}/") :
"/universe/stations/#{location_id}/")
... I would think it's easy enough to get this data thru the |
@Blacksmoke16 get what you're saying in which case how about a better way to lookup a location? Right now there is no way to translate a location ID through the ESI. It requires knowledge that cannot be found in the ESI API Spec or the docs at present which doesn't feel right. |
Also, when you have found what you want in the ESI, you can't just do:
Because one endpoint returns |
It is documented, https://docs.esi.evetech.net/docs/id_ranges.html. You also have to take the context of the endpoint you're using into consideration. In this case contracts can only ever originate from a structure or a station, so doing a simple check on the size of the I would also suggest/assume you're keeping a database of previously resolved locations; this would make what you want easier as you only have to resolve locations you haven't seen before.
That is an issue on its own, see #1029. But I'm not sure I see how that fits into this discussion. Either way, I'll leave this open for some other @esi/ecm to give their thoughts. Then we can go from there. |
I think this is a valid request, not because of the extra requests required, but because the character may not have access to the start/end location if they are structures. Thanks to the structure deliveries system, those contracts may still be of interest, and having a way of resolving the system id in those cases would be good. |
This could be abused. If somebody gives an app access to contracts but not to structures, exposing the |
Hm, that's a fair point. On the other hand, |
Good Point, wasn't aware of that. Just wanted to point it out. Not saying this wouldn't be valuable, that is just the first thing that came to mind. |
@Blacksmoke16 you're right I did not see that documented. Well spotted. @ddouglas this is character contracts though. The player can see in game the system that the structure is located by opening the contract details so I fail to see a security hole here. @lukasni I agree that being able to identify that a contract is in a structure the user has no access to is also a valid use case here. This would likely be useful to JF pilots etc. |
After thinking on this more, I agree it's a good idea. EDIT: This would actually be super helpful for a project I'm currently working on. |
Feature Request
When looking at contracts via the ESI, it would be useful to have the system ID included in the response similar to 'start_location_id' and 'end_location_id'. You could use 'start_system_id' or 'end_system_id'.
Using the above existing fields is cubersome and usually you're not bothered if a contract is in a specific structure. Furthermore, there is seemingly no way to translate a location ID to a system ID. For example, location ID 1031461794475. It appears to not be accepted by any of the look up endpoints.
Instead, we have to use a reference to look up the type of location it is and then go to look up the location (reference)
A different solution could be to add the location type to the location so for example
'start_location_id': 123456
becomes'start_location': {'id': 123456, 'type': station}
. Possible types could be citadel, station etc.Use case
Anyone dealing with contracts who wants to aggregate details by system ID. For example, alliances checking that dotrines are stocked or contract seeders checking their own stock levels.
Authentication
Both solutions above use the existing contract endpoint which already has auth required.
Example return
Alternatively:
Checklist
Check all boxes that apply to this issue:
The text was updated successfully, but these errors were encountered: