new Fittings(agent, characterId, token)
Create a new Fittings function using the given agent, for the
character described by characterId with SSO access from token.
Parameters:
| Name | Type | Description |
|---|---|---|
agent |
ESIAgent | The ESI agent |
characterId |
Number | The character id whose fittings are accessed |
token |
String | The SSO access token for the character |
Methods
-
add(fitting)
-
Save a new fitting for a character.
This makes an HTTP POST request to
/characters/{character_id}/fittings/. The route version isv1.An example value for
fittingis shown below:{ "description": "description string", "items": [ { "flag": 0, "quantity": 0, "type_id": 0 } ], "name": "name string", "ship_type_id": 0 }On success, this resolves to the id of the created entity. The id is extracted from the
fitting_idproperty of the response object.This function must be used with an SSO token that has the following scopes:
esi-fittings.write_fittings.v1
Parameters:
Name Type Description fittingObject Details about the new fitting.
Returns:
A Promise that resolves to an id.
- Type
- Promise.<Number>
-
all()
-
Return fittings of a character. This route is cached for up to 300 seconds.
This makes an HTTP GET request to
/characters/{character_id}/fittings/. The route version isv1.On success, this resolves to a list of fittings. An example result is:
[ { "description": "Awesome Vindi fitting", "fitting_id": 1, "items": [ { "flag": 12, "quantity": 1, "type_id": 1234 } ], "name": "Best Vindicator", "ship_type_id": 123 } ]This function must be used with an SSO token that has the following scopes:
esi-fittings.read_fittings.v1
Returns:
A Promise that resolves to the parsed JSON of the response.
- Type
- Promise.<Array.<Object>>
-
get(id)
-
Create a new Fitting end point targeting the particular fitting by
id.Parameters:
Name Type Description idNumber The fitting id
Returns:
- Type
- Fitting