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

3. Authenticated Endpoints

SimplyUnnamed edited this page Aug 13, 2021 · 1 revision

Many Esi endpoints require a user's authentication, and the necessary scopes. It's up to you to ensure the character is registered with the required scopes.

To use the authenticated endpoints, you will need to store a users refresh tokens. This can be done using the refresh token model

$token = \LaravelEveTools\EveApi\Models\RefreshToken::updateOrInsert([
    'character_id'=> 
    'version' => RefreshToken::CURRENT_VERSION,
    'user_id' => 
    'refreh_token' => 
    'scopes'  => [],
    'token'    =>
    'character_owner_hash' => 
]);

When calling a job, you need to provide the refresh token model as an argument.

using CharacterRoles as an example:

<?php
namespace App\Jobs\Characters;
use LaravelEveTools\EveApi\Jobs\Characters\Roles;

class CharacterRoles extends Roles
{

    public function handle()
    {
        // TODO: Implement handle() method.
    }
}

You would call this job like this

$token = RefreshToken::find($character_id);
CharacterInfo::dispatch($token);

Clone this wiki locally