src/snac/server/ServerExecutor.php
/**
     * Generate User API Key
     *
     * Uses the APIKeyGenerator to generate a new API key and stores it in the database.
     * The process of storing creates an expiration time (currently 1 year after the
     * generation time).  The first 8 characters of the key are left un-encrypted as a lable
     * to refer to the key for the user.
     *
     * @throws \snac\exceptions\SNACDatabaseException
     * @return string[] The response to send to the client
     */
Generate User API Key
Uses the APIKeyGenerator to generate a new API key and stores it in the database.
The process of storing creates an expiration time (currently 1 year after the
generation time).  The first 8 characters of the key are left un-encrypted as a lable
to refer to the key for the user.

@throws \snac\exceptions\SNACDatabaseException
@return string[] The response to send to the client
Generate User API Key Uses the APIKeyGenerator to generate a new API key and stores it in the database . The process of storing creates an expiration time ( currently 1 year after the generation time ) . The first 8 characters of the key are left un - encrypted as a lable to refer to the key for the user . @throws \ snac \ exceptions \ SNACDatabaseException @return string [] The response to send to the client
public function generateUserAPIKey() {
        if ($this->user != null && $this->user !== false) {
            $key = $this->uStore->generateUserAPIKey($this->user);
            if ($key == null) {
                throw new \snac\exceptions\SNACDatabaseException("User API key could not be generated.");
            }
            $response = [
                "result" => "success",
                "key" => $key->toArray()
            ];
            return $response;
        }
    }
public function generateUserAPIKey ( ) { if ( $ this -> user != null && $ this -> user !== false ) { $ key = $ this -> uStore -> generateUserAPIKey ( $ this -> user ) ; if ( $ key == null ) { throw new \ snac \ exceptions \ SNACDatabaseException ( " User API key could not be generated. " ) ; } $ response = [ " result " => " success " , " key " => $ key -> toArray ( ) ] ; return $ response ; } }
Generate User API Key
 Uses the APIKeyGenerator to generate a new API key and stores it in the database.
Generate User API Key Uses the APIKeyGenerator to generate a new API key and stores it in the database .
// can only generate an API key for logged-in users //error