Skip to content
This repository was archived by the owner on Nov 13, 2025. It is now read-only.

4. Request Parameters

SimplyUnnamed edited this page Aug 13, 2021 · 1 revision

URl Parameters

A lot of esi endpoints require an auth token, but also require an id that isn't a character id, ie, a corporation id.

These are provided in the constructor, in the same order as specified in the url end point, with the refresh token, if required being provided last.

for example, /corporations/{corporation_id}/starbases/{starbase_id}/ would be called like this:

//Assuming StarbaseDetails extends \LaravelEveTools\EveApi\Jobs\Corporations\StarbaseDetails
$token = RefreshToken::find($character_id);
StarbaseDetails::dispatch($corporation_id, $starbase_id, $token);

Query Parameters and Request Body

Some endpoints require additional information through the query string, or in the request body. These have to be set in the handle function before calling retrieve. Check https://esi.evetech.net/ui/#/ for what query sting and request body parameters are required.

Take this job, which adds contacts with a good standing.

namespace App\Jobs\Characters;

use App\Models\RefreshToken;
use LaravelEveTools\EveApi\Jobs\Contacts\Characters\AddContact;

class AddGoodContacts extends AddContact
{

    /**
     * @var int[]
     */
    private array $contact_ids;

    /**
     * @var int[]
     */
    private array $label_ids;

    public function __construct(RefreshToken $token, array $contact_ids,array  $label_ids = [])
    {
        $this->contact_ids = $contact_ids;
        $this->label_ids = $label_ids;
        parent::__construct($token);
    }

    public function handle()
    {
        $this->query_string['label_ids'] = $this->label_ids;
        $this->query_string['standing'] = 5;
        $this->request_body['contact_ids'] = $this->contact_ids;
        $result = $this->retrieve();
    }
}

We can then call this

$token = RefreshToken::find($character_id);
AddGoodStanding::dispatch($token, $good_characters_ids);

Clone this wiki locally