new Characters(agent)
Create a new Characters function using the given agent.
Parameters:
| Name | Type | Description |
|---|---|---|
agent |
ESIAgent | The ESI agent |
Members
-
search :Search
-
A Search module instance configured to search over the
'character'type.Type:
Methods
-
affiliations(ids)
-
Bulk lookup of character IDs to corporation, alliance and faction. This route is cached for up to 3600 seconds.
This makes an HTTP POST request to
/characters/affiliation/. The route version isv1.The array length of
idsmust be between1and1000.On success, this resolves to character corporation, alliance and faction IDs. An example result is:
[ { "alliance_id": 434243723, "character_id": 95538921, "corporation_id": 109299958, "faction_id": 0 } ]Parameters:
Name Type Description idsArray.<Number> The character IDs to fetch affiliations for.
Returns:
A Promise that resolves to the parsed JSON of the response.
- Type
- Promise.<Array.<Object>>
-
get(id, token)
-
Create a new CharacterInfo or Character end point targeting the particular character by
id. Iftokenis provided then an authorized Character is returned, otherwise the non-authenticated CharacterInfo is returned.Parameters:
Name Type Description idNumber The character id
tokenString Optional; the character's SSO token
Returns:
- Type
- Character | CharacterInfo
-
names(ids)
-
Resolve a set of character IDs to character names. This route is cached for up to 3600 seconds.
This makes an HTTP GET request to
/characters/names/. The route version isv1.The array length of
idsmust be between1and1000.On success, this resolves to list of id/name associations. An example result is:
[ { "id": 95465499, "name": "CCP Bartender" } ]Note that the type schema of the response is modified from what is defined in ESI. Specifically:
- The
character_idproperty is renamed toid. - The
character_nameproperty is renamed toname.
Parameters:
Name Type Description idsArray.<Number> A comma separated list of character IDs.
Returns:
A Promise that resolves to the parsed JSON of the response.
- Type
- Promise.<Array.<Object>>
- The