# ESI - Endpoint for Corporate Hangar Divisions for non-Directors please?

**URL:** <https://forums.eveonline.com/t/esi-endpoint-for-corporate-hangar-divisions-for-non-directors-please/427425>\
**Category:** Third Party Developers\
**Created:** [November 12, 2023, 2:52pm UTC](https://forums.eveonline.com/t/esi-endpoint-for-corporate-hangar-divisions-for-non-directors-please/427425 "2023-11-12T14:52:43Z")\
**Posts on this page:** 9\
**Page:** 2

<div class="post-metadata">

**Author:** ![Jack\_McKnox](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/jack_mcknox/32/393989_2.png) [@Jack\_McKnox](https://forums.eveonline.com/u/Jack_McKnox)\
**Post date:** [November 14, 2023, 11:19am UTC](https://forums.eveonline.com/t/esi-endpoint-for-corporate-hangar-divisions-for-non-directors-please/427425/21 "2023-11-14T11:19:31Z")

</div>

Just to return to the location topic for a second - you say that only Directors should know about all the structures the corp has. However corp hangars are only present in structures and stations that have corporate offices in them (as far as pos-es go you need a special addon to it that contains a hangar iirc).  
The corporate offices can be viewed by any corp member via the corporation details tab. So is that really a problem? Or is it about something else?

---

<div class="post-metadata">

**Author:** ![stefnia\_Freir](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/stefnia_freir/32/390048_2.png) [@stefnia\_Freir](https://forums.eveonline.com/u/stefnia_Freir)\
**Post date:** [November 14, 2023, 11:36am UTC](https://forums.eveonline.com/t/esi-endpoint-for-corporate-hangar-divisions-for-non-directors-please/427425/22 "2023-11-14T11:36:00Z")

</div>

No, you’re right that then this becomes a non-problem from the game.  
It still is a privilege escalation from the API.

Also I was talking about the structures, not the offices. You can have offices in another corporation’s structure.  
You are correct that you can still list the offices by hand in the game and then list the structures along with their owner corporation. This is not a function that was added in ESI.

If I understand correctly, what you want is, once retrieved the list of assets for a specific division, to resolve the location this asset is placed in.

This [EVE Swagger Interface](https://esi.evetech.net/ui/#/Corporation/get_corporations_corporation_id_structures) is the endpoint you use to know what structure your office is in IIRC. It requires some specific rights (station manager)  
IMO the best way to solve that issue would be to drop a container named with the structure name in your own inventory. Something like Jita IV - moon 4 . IIRC that does not work for corporation assets because then the name path does not work (can’t recall which ids are ok and which are not).

---

<div class="post-metadata">

**Author:** ![Jack\_McKnox](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/jack_mcknox/32/393989_2.png) [@Jack\_McKnox](https://forums.eveonline.com/u/Jack_McKnox)\
**Post date:** [November 14, 2023, 11:42am UTC](https://forums.eveonline.com/t/esi-endpoint-for-corporate-hangar-divisions-for-non-directors-please/427425/23 "2023-11-14T11:42:38Z")

</div>

What I want from this specifically is to list and aggregate assets placed in a specific corporate hangar division for the purpose of checking material stock levels for corp industrial projects. Getting to know at a glance what is available and where would be of great help.

I can do my own assets just fine, but from the perspective of a corp officer trying to run a program (but not running the whole corp) all I’m left with at the moment is visiting each station that is supposed to have materials (refineries, manufacturing structures) and copy pasting stuff from there into the sheet. Annoying but bearable for small projects, a chore for something bigger.

---

<div class="post-metadata">

**Author:** ![stefnia\_Freir](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/stefnia_freir/32/390048_2.png) [@stefnia\_Freir](https://forums.eveonline.com/u/stefnia_Freir)\
**Post date:** [November 14, 2023, 12:03pm UTC](https://forums.eveonline.com/t/esi-endpoint-for-corporate-hangar-divisions-for-non-directors-please/427425/24 "2023-11-14T12:03:00Z")

</div>

I agree that this is bad. Hence

> [@stefnia\_Freir](#):
>
> I totally understand your need and agree with it.

So first an advice in the not-so-short term : as an indus you should have your own corporation.  
But I know it’s not always possible.

Also I think I was wrong, if you have access to the structure you can use this path [EVE Swagger Interface](https://esi.evetech.net/ui/#/Universe/get_universe_structures_structure_id) to resolve the structure, so the location of your assets (when they have the location\_flag set to corpAgX).

So there should not be a need for a specific locations/ path. Only corporations/id/divisions/id/assets (which has its own issues) and names/ which does not work correctly for corporations (unless it’s been fixed in the last 4 years ?)

Let’s refine the use case :

1. user calls the new path corporations/corpid/divisions/divid/assets to list his assets :
  1. ESI checks that the user is in that corporation, and his roles or titles’ roles grant the access to that division in the hq, base and other . Otherwise he gets a forbidden.
  2. ESI lists the offices of that corporation that have the flag listESIdivId set to true
  3. ESI then lists and returns the assets in those offices that are in the corresponding office, and recursively their children

2. user rebuild his own asset forest.
3. user calls the existing path [EVE Swagger Interface](https://esi.evetech.net/ui/#/Universe/get_universe_structures_structure_id) to know what structure his roots are in when they are not static (stations).
4. user calls the new corporations/corpId/divisions/divId/names/ to get the names of the assets that belong to that corporation, that division. Only work on top level containers (not on ships in containers).
  1. ESI makes the same checks that in the first path.
  2. ESI also makes the same resolution for allowed offices
  3. ESI list the item\_id and names of the assets for wich the owner is the corporation id, the location\_flag is corpagdivId, the location\_id is among those allowed, and the item\_id is one of those transmited

Is that right ?

---

<div class="post-metadata">

**Author:** ![Jack\_McKnox](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/jack_mcknox/32/393989_2.png) [@Jack\_McKnox](https://forums.eveonline.com/u/Jack_McKnox)\
**Post date:** [November 14, 2023, 12:23pm UTC](https://forums.eveonline.com/t/esi-endpoint-for-corporate-hangar-divisions-for-non-directors-please/427425/25 "2023-11-14T12:23:45Z")

</div>

> [@stefnia\_Freir](#):
>
> user calls the new path corporations/corpid/divisions/divid/assets to list his assets :
> 
> 1. ESI checks that the user is in that corporation, and his roles or titles’ roles grant the access to that division in the hq, base and other . Otherwise he gets a forbidden.
> 2. ESI lists the offices of that corporation that have the flag listESIdivId set to true
> 3. ESI then lists and returns the assets in those offices that are in the corresponding office, and recursively their children

There’s a problem here I think. Since the path calls for assets in a divID there should not be a location specified, nor a location should need a flag set. Hangar division names (and id’s) are the same for every office the corporation has. So for example calling for a list of assets of {corporationID} in hangar {divisionID} should return assets in that hangar in _ **all offices the corporation has** _. So a location ID should be part of the returned list.  
Now technically this should not be a problem since every corp member has access to a list of all corporate offices, and, if they also have query access to a hangar division - go there and see the assets for themselves.

Unless maybe they’re on a blocklist to dock in the structure of their own corp? Is that possible?

---

<div class="post-metadata">

**Author:** ![stefnia\_Freir](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/stefnia_freir/32/390048_2.png) [@stefnia\_Freir](https://forums.eveonline.com/u/stefnia_Freir)\
**Post date:** [November 14, 2023, 12:35pm UTC](https://forums.eveonline.com/t/esi-endpoint-for-corporate-hangar-divisions-for-non-directors-please/427425/26 "2023-11-14T12:35:06Z")

</div>

This flag is to prevent a privilege escalation. At the moment we can’t access data. So this must be opt-in.  
You cannot say all of the sudden, everybody with the role to look at the div in the game, now can do it the same in ESI. Because right now, it’s not possible.  
Say you give access to your bedroom to your parents, to living room to your friends, to the entrance to identified people. It may make sense that your kids access your bedroom, but this must be opt-in, you may have things that are not for kids in there.

Therefore :  
So for example calling for a list of assets of {corporationID} in hangar {divisionID} should return assets in that hangar in all offices the corporation has _ **which are opted in** _ .

And the location id is part of the return already ? I don’t get it.

ACL only prevent the resolving of the locations in that context (call 2. )

---

<div class="post-metadata">

**Author:** ![Jack\_McKnox](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/jack_mcknox/32/393989_2.png) [@Jack\_McKnox](https://forums.eveonline.com/u/Jack_McKnox)\
**Post date:** [November 14, 2023, 12:39pm UTC](https://forums.eveonline.com/t/esi-endpoint-for-corporate-hangar-divisions-for-non-directors-please/427425/27 "2023-11-14T12:39:40Z")

</div>

Gotcha and agree.

As for the location part - it’s part of the return in other asset calls through ESI. If I call to return the assets of my character and am authorized to do so a location ID is part of the table returned, and I would suspect it would be the same if a Director called for a return of corporate assets.  
So I guess for this part it would also return location IDs for structures that **are opted in**.

Of course the only part there is the locationID. To get actual location info from that ID one would still need to call the universe/structures/{structure\_id}/ endpoint with that ID as a variable.  
Most probably depending on the range the ID is in, it would be a structure, hangar division in a structure or a cargo container in a hangar division in a structure 😛 so a variety of calls would be needed depending on that.

---

<div class="post-metadata">

**Author:** ![stefnia\_Freir](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/stefnia_freir/32/390048_2.png) [@stefnia\_Freir](https://forums.eveonline.com/u/stefnia_Freir)\
**Post date:** [November 14, 2023, 1:19pm UTC](https://forums.eveonline.com/t/esi-endpoint-for-corporate-hangar-divisions-for-non-directors-please/427425/28 "2023-11-14T13:19:34Z")

</div>

> [@Jack\_McKnox](#):
>
> So I guess for this part it would also return location IDs for structures that **are opted in**.

No.  
It returns only items in a structure that is opted in (see step 1.2.)

All assets retrieved have their parent. depending on the location\_flag you can tell what it is in.  
When that flag is corpagX (or deliveries, safety or impounded) then it means the asset is in an office at location location\_id

That’s why you need to rebuild your asset forest : each tree has the location (station/structure) at its root.  
Say I have a structure with id 1 and a container with id 2 in div 1, and a plex with id 3 in that container.  
the structure will be present in assets with parent id as its system.  
The container will be present in assets with parent id=1, location\_flag corpag1  
The plex will be present in asset with parent id=2, locationflag = cargo(not sure)  
So if you take only those with divid=1, you will return only the container and the plex (the plex because it is a child of the container, not because it has divid=1, since it does not). Then you build your forest, there is one tree with container at its root, and the location is unknown. So you must resolve the tree location to the structure information.

> [@Jack\_McKnox](#):
>
> Most probably depending on the range the ID is in,

yes and also the flags provided in the asset.  
No need for many calls. Once you made your forest, you just need to list the roots, and find those with a good locaiton\_id, location\_flag location\_type, and resolve those location\_id .  
That was step 3.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/eveonline/original/3X/4/1/41ec4921cbaca7a6f9ea556e7cc20018461eae5e.png) [@system](https://forums.eveonline.com/u/system)\
**Post date:** [February 12, 2024, 1:20pm UTC](https://forums.eveonline.com/t/esi-endpoint-for-corporate-hangar-divisions-for-non-directors-please/427425/29 "2024-02-12T13:20:09Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

[Previous page](https://forums.eveonline.com/t/esi-endpoint-for-corporate-hangar-divisions-for-non-directors-please/427425.md?page=1)
