Skip to content

Add Graph API version to base URI #195

Description

Is your feature request related to a problem? Please describe the problem.

Currently, the base URI only contains the national cloud host, meaning each request needs a Graph API version prefix:

$httpClient = GraphClientFactory::createWithConfig($config);
$response = $httpClient->get("/v1.0/me");

Current workaround is to override the base_uri via config:

$httpClient = GraphClientFactory::createWithConfig(['base_uri' => NationalCloud::Global + "/v1.0"]);
$response = $httpClient->get("/me");

This would be a breaking change.

Describe the solution you'd like.

Support setting the Graph API version via the factory & default to v1.0
(With default v1.0)

$httpClient = GraphClientFactory::create();
$response = $httpClient->get("/me");

Or to change to beta

$httpClient = GraphClientFactory::setApiVersion('beta')::create();
$response = $httpClient->get("/me");

Additional context?

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions