Download the PHP package richard4339/destiny2-php without Composer
On this page you can find all versions of the php package richard4339/destiny2-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download richard4339/destiny2-php
More information about richard4339/destiny2-php
Files in richard4339/destiny2-php
Package destiny2-php
Short Description PHP wrapper for the Destiny 2 API
License MIT
Informations about the package destiny2-php
destiny2-php
A PHP wrapper for the Destiny 2 API
About
Currently includes (mostly) just the clan endpoints, with some user endpoints. Basic vendor support has been added as well (Xur's hash is FYI). The goal is to eventually have all endpoints available.
My intention is to make all object calls be JSON Serializable by implementing JsonSerializable()
Installation
Using Composer
Upgrading
To 0.3
ClanApproveMember()
method now returns an object instead of a boolean. Any calls to this method that check for a boolean must change.ClanKickMember()
method now returns a boolean for success instead of the abstracted Guzzle response.
Usage
The optional App Name, Version, ID, URL, and Email fields were added to populate the User-Agent in the header, which is now recommended by Bungie (and may eventually be required).
Symfony
If you want to use this in a Symfony project, the code below can be used to wire the service in services.yaml
for calls that do not require OAuth:
Replace [YOUR APP NAME]
, [YOUR APP VERSION]
, [YOUR APP ID]
, [YOUR APP URL]
, and [YOUR EMAIL]
.
It also assumes you have defined your API key defined in your services.yaml
as well:
For calls that require OAuth, you need to extend Client
and wire your token in. The code below is just an example that works using the Security component which can get the token from the User.
services.yaml
wiring:
Requirements
- Uses the GuzzleHTTP package
- Requires PHP 7.1
- Bungie API Key (get that here)
- For some calls, an OAuth token
Destiny API Resources
If you need assistance with the Destiny API, there are a bunch of great resources maintained by a few wonderful community members!
And specifically the devs below who build and maintain these community resources