Class: Contact

Contact

An api adapter that provides functions for modifying and removing a particular contact of a character, specified by id via functions in the contacts ESI endpoints.

You should not usually instantiate this directly as its constructor requires an internal api instance.


new Contact(contacts, contactId)

Create a new Contact represented as contactId from the given contacts.

Parameters:
Name Type Description
contacts Contacts

The contacts owning the contact

contactId Number

The contact id that is used for all requests

Methods


del()

Bulk delete contacts.

This makes an HTTP DELETE request to /characters/{character_id}/contacts/. The route version is v1.

On success, this resolves to an empty object.

This function must be used with an SSO token that has the following scopes:

  • esi-characters.write_contacts.v1
Returns:

A Promise that resolves to an empty object.

Type
Promise.<Object>

update(standing, label)

Bulk edit contacts with same settings.

This makes an HTTP PUT request to /characters/{character_id}/contacts/. The route version is v1.

This function invokes the route with watched set to false. standing must be between -10 and 10.

On success, this resolves to an empty object.

This function must be used with an SSO token that has the following scopes:

  • esi-characters.write_contacts.v1
Parameters:
Name Type Description
standing Number

Standing for the contact.

label Number

Add a custom label to the contact, use 0 for clearing label.

Returns:

A Promise that resolves to an empty object.

Type
Promise.<Object>

updateWatched(standing, label)

Bulk edit contacts with same settings.

This makes an HTTP PUT request to /characters/{character_id}/contacts/. The route version is v1.

This function invokes the route with watched set to true. standing must be between -10 and 10.

On success, this resolves to an empty object.

This function must be used with an SSO token that has the following scopes:

  • esi-characters.write_contacts.v1
Parameters:
Name Type Description
standing Number

Standing for the contact.

label Number

Add a custom label to the contact, use 0 for clearing label.

Returns:

A Promise that resolves to an empty object.

Type
Promise.<Object>