Skip to content

BuiltByBit/api-wrapper-codegen-php

Repository files navigation

builtbybit/api-wrapper-codegen-php

All operations not tagged 'free' require an active Ultimate subscription or invite-only permissions.

V2 documentation: https://builtbybit.com/wiki/api-v2/ \ OAuth2 documentation: https://builtbybit.com/wiki/oauth2/

For more information, please visit https://builtbybit.com/ticket.

Installation & Usage

Requirements

PHP 7.4 and later. Should also work with PHP 8.0.

Composer

To install the bindings via Composer, add the following to composer.json:

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/BuiltByBit/api-wrapper-codegen-php.git"
    }
  ],
  "require": {
    "BuiltByBit/api-wrapper-codegen-php": "*@dev"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

<?php
require_once('/path/to/builtbybit/api-wrapper-codegen-php/vendor/autoload.php');

Getting Started

Please follow the installation procedure and then run the following:

<?php
require_once(__DIR__ . '/vendor/autoload.php');



// Configure API key authorization: token
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');


$apiInstance = new OpenAPI\Client\Api\GlobalApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);

try {
    $result = $apiInstance->getV2Analytics();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling GlobalApi->getV2Analytics: ', $e->getMessage(), PHP_EOL;
}

API Endpoints

All URIs are relative to https://api.builtbybit.com

Class Method HTTP request Description
GlobalApi getV2Analytics GET /v2/analytics Fetch a list of analytics definitions
GlobalApi getV2AnalyticsGraph GET /v2/analytics/graph Fetch analytics graph data
GlobalApi getV2AnalyticsSingle GET /v2/analytics/single Fetch a single analytics value
GlobalApi getV2Events GET /v2/events Fetch a list of pending events
GlobalApi postV2EventsComplete POST /v2/events/complete Mark events as complete
Oauth2Api getOauth2Token POST /oauth2/token Request an access token using an existing grant
Oauth2Api getOauth2TokenRevoke POST /oauth2/token/revoke Revoke an existing access or refresh token
ResourcesCreatorApi postV2ResourcesCreatorUpdate POST /v2/resources/creator/update Post a resource update
ResourcesDiscoveryApi getResourcesDiscoverCategories GET /v2/resources/discover/categories Fetch a list of categories
ResourcesDiscoveryApi getResourcesDiscoverResources GET /v2/resources/discover/resources Fetch a list of resources
ResourcesDiscoveryApi getV2ResourcesDiscoverCartView GET /v2/resources/discover/cart/view View the user's cart items
ResourcesDiscoveryApi getV2ResourcesDiscoverLicenses GET /v2/resources/discover/licenses Fetch a list of the user's licenses
ResourcesDiscoveryApi postV2ResourcesDiscoverCartAdd POST /v2/resources/discover/cart/add Add items to a user's cart
ResourcesDiscoveryApi postV2ResourcesDiscoverCartCheckout POST /v2/resources/discover/cart/checkout Initiate a checkout of a user's cart
ResourcesDiscoveryApi postV2ResourcesDiscoverCartCouponAdd POST /v2/resources/discover/cart/coupon/add Add a coupon to the user's cart
ResourcesDiscoveryApi postV2ResourcesDiscoverCartCouponRemove POST /v2/resources/discover/cart/coupon/remove Remove a coupon from the user's cart
ResourcesDiscoveryApi postV2ResourcesDiscoverCartRemove POST /v2/resources/discover/cart/remove Remove an item from the user's cart

Models

Authorization

Authentication schemes defined for the API:

token

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header

oauth2

  • Type: OAuth
  • Flow: accessCode
  • Authorization URL: https://builtbybit.com/account/external/authorize
  • Scopes: N/A

Tests

To run the tests, use:

composer install
vendor/bin/phpunit

Author

About this package

This PHP package is automatically generated by the OpenAPI Generator project:

  • API version: v2
  • Build package: org.openapitools.codegen.languages.PhpClientCodegen

About

A PHP API wrapper code-generated from our OpenAPI specification.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors