Creates the qualified api endpoint for retrieving the desired data

@param   string  $endpoint  the shortname of the endpoint
@param   string  $orcid     the orcid to look up, if not already specified
@return  string
496062
private function getApiEndpoint($endpoint, $orcid = null)
    {
        $url  = 'https://';
        $url .= $this->level . '.';
        $url .= (!empty($this->environment)) ? $this->environment . '.' : '';
        $url .= self::HOSTNAME;
        $url .= '/v' . self::VERSION . '/';
        $url .= $orcid ?: $this->getOrcid();
        $url .= '/' . $endpoint;

        return $url;
    }
923433
protected function buildRequestUrl($endpoint, $params = null)
    {
        if($this->user == null)
            throw new Exception("Please authenticate user first!");

        $requestPath = $this->requestPath . $endpoint . ".json". $this->getParams( $params );

        return $requestPath;
    }
1369811
protected function buildUrl($endpoint = '', $type = 'api')
    {
        //Get the base path
        $base = $this->getBasePath();

        //If the endpoint type is 'upload'
        if ($type === 'upload') {
            //Get the Content Path
            $base = $this->getUploadPath();
        }

        //Join and return the base and api path/endpoint
        return $base . $endpoint;
    }
754606
public function getSchema($endpoint)
    {
        //remove base path
        if ('/' !== $this->basePath) {
            $endpoint = str_replace($this->basePath, '', $endpoint);
        }
        $retVal = new \stdClass();
        if (array_key_exists($endpoint, $this->schemes)) {
            $retVal = $this->schemes[$endpoint];
        }

        return $retVal;
    }
716088
public function get($endpoint, $params = [])
    {
        // build url
        $url = $this->domain . '/' . $endpoint;

        if (!empty($params)) {
            $url = $url . '?' . http_build_query($params);
        }

        $request = new Request($url);
        
        // Add client secret header
        if (isset($this->config['secret'])) {
            $request->headers->add(['X-Client-Secret' => $this->config['secret']]);
        }
        
        // add curl options
        if (isset($this->config['curl']) && is_array($this->config['curl'])) {
            foreach ($this->config['curl'] as $option => $value) {
                $request->setOption($option, $value);
            }
        }
        
        $request->execute();

        return $request->getResponse();
    }
1013417
protected function buildUrl($endpoint, $params)
    {
        $url = $this->getOAuthApiRoot();
        $scheme = parse_url($url, PHP_URL_SCHEME);
        $authority = parse_url($url, PHP_URL_HOST);
        $path = parse_url($url, PHP_URL_PATH);
        $path .= trim($endpoint, '/');
        $fragment = '';
        $uri = Uri::composeComponents(
            $scheme,
            $authority,
            $path,
            build_query($params),
            $fragment
        );
        return $uri;
    }
1354644
protected function getOrigin($endPoint)
    {
        $url = parse_url($endPoint);
        $origin = $url['scheme'].'://'.$url['host'];
        if (isset($url['port'])) {
            $origin = $origin.':'.$url['port'];
        }

        return $origin;
    }
969334
private function getResponse($endpoint, array $json) 
    {
        $result = null;
        // endpoint
        $uri = $this->config->getBaseUrl() . $endpoint;
        try {
            $response = $this->client->post(
                $uri, [
                'json' => $json,
                ]
            );
            // @todo $request->getHeader('content-type')
            if($response->getStatusCode() == '200') {
                $result = json_decode($response->getBody(), true);
            }else{
                echo 'ERROR: Status code ' . $response->getStatusCode();
            }
            // @todo check thrown exception
        } catch (\Exception $exception) {
            echo 'ERROR: ' . $exception->getMessage();
        }
        return $result;
    }
85832
public static function generateCrudEndpoints(string $permission, string $endpoint)
    {
        return collect(self::ROUTE_CRUD_PERMISSION)
            ->map(function ($suffix, $method) use ($permission, $endpoint) {
                if (Gate::allows("{$permission}_{$suffix}")) {
                    return [$method => $endpoint];
                }
            })->collapse();
    }
762852
protected function getStream(string $endpoint, array $params)
    {
        $response = $this->requestRaw($endpoint, 'POST', ['json' => $params]);

        if (false !== stripos($response->getHeaderLine('Content-disposition'), 'attachment')) {
            return StreamResponse::buildFromPsrResponse($response);
        }

        return $this->castResponseToType($response, $this->app['config']->get('response_type'));
    }
1040009
public function hasEndpoint($endpoint)
    {
        $retVal = false;
        if (isset($this->endpoints)) {
            $retVal = in_array($endpoint, $this->endpoints);
        }

        return $retVal;
    }
1044086
public function get($endpoint, $options = [])
    {
        return $this->request('GET', 'rest/v1/users/' . $this->userId . '/' . $endpoint . '?' . http_build_query($options));
    }
753543
public function endpoint(ApiEndpoint $endpoint)
    {
        $this->endpointsByName[$endpoint->getName()] = $endpoint;

        switch ($endpoint->getHttpMethod()) {

            case HttpMethods::GET:

                $this->get($endpoint->getPath(), $endpoint->getHandlerMethod(), $this->createRouteName($endpoint));
                break;

            case HttpMethods::POST:

                $this->post($endpoint->getPath(), $endpoint->getHandlerMethod(), $this->createRouteName($endpoint));
                break;

            case HttpMethods::PUT:

                $this->put($endpoint->getPath(), $endpoint->getHandlerMethod(), $this->createRouteName($endpoint));
                break;

            case HttpMethods::DELETE:

                $this->delete($endpoint->getPath(), $endpoint->getHandlerMethod(), $this->createRouteName($endpoint));
                break;
        }

        return $this;
    }
1269734
protected function buildRequest(Endpoint $endpoint, $options = [])
    {
        $uri = UriFactoryDiscovery::find()->createUri($endpoint->getUrl());
        
        return MessageFactoryDiscovery::find()
            ->createRequest(
                'GET',
                count($options) > 0 ? $uri->withQuery(preg_replace('/%5B[0-9]+%5D/simU', '', http_build_query($options))) : $uri
            );
    }
981048
private static function parseEndPoint(string $endPoint)
    {
        $endPoint = trim($endPoint, '/');
        $endPointArray = explode('/', $endPoint);
        if ($endPointArray[0] == "api") {
            return $endPoint;
        }
        array_unshift($endPointArray, "api");

        return implode('/', array_filter($endPointArray));
    }
19445
public function get($endpoint, array $parameters = array())
    {
        if (!empty($parameters)) {
            $path = sprintf("%s/?%s", $endpoint, http_build_query($parameters));
        } else {
            $path = $endpoint;
        }

        return $this->execute("GET", sprintf("%s%s", $this->host, $path));
    }
154010
public static function requestApi($endpoint, $data, $cert = false): Collection
    {
        Events::dispatch(Events::API_REQUESTING, new Events\ApiRequesting('Wechat', '', self::$instance->getBaseUri().$endpoint, $data));

        $result = self::$instance->post(
            $endpoint,
            self::toXml($data),
            $cert ? [
                'cert'    => self::$instance->cert_client,
                'ssl_key' => self::$instance->cert_key,
            ] : []
        );
        $result = is_array($result) ? $result : self::fromXml($result);

        Events::dispatch(Events::API_REQUESTED, new Events\ApiRequested('Wechat', '', self::$instance->getBaseUri().$endpoint, $result));

        return self::processingApiResult($endpoint, $result);
    }