Download the PHP package 99designs/sipht without Composer
On this page you can find all versions of the php package 99designs/sipht. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download 99designs/sipht
More information about 99designs/sipht
Files in 99designs/sipht
Package sipht
Short Description A PHP client for the Sift Science REST API
License MIT
Informations about the package sipht
A PHP client for the Sift Science REST API.
Note: Sift Science now offer their own PHP bindings here.
This client supports the three basic operations exposed by the Sift API: posting events, labelling users and fetching scores.
The currently supported API version is v203
.
Instantiating a client
Interactions with the API occur via Sift\Client
. You instantiate a client by
passing your API key to its constructor:
The following errors may be thrown by any client request:
-
Sift\Exception\BadRequestException
: HTTP 40x; the request was rejected by the API -
Sift\Exception\ServerErrorException
: HTTP 50x; the API endpoint suffered some internal problem Sift\Exception\HttpException
: any other exception generated in the course of making the HTTP request (e.g. too many redirects)
Posting events
Create instances of Sift\Event
, e.g.:
Alternatively, factory constructors are provided for each event type:
Then post the event via Sift\Client::postEvent()
:
See https://siftscience.com/docs/references/events-api for more information on posting event data.
Labelling users
Create label objects using the factory methods of Sift\Label
, e.g.:
Then post the event via Sift\Client::labelUser()
:
See https://siftscience.com/docs/references/labels-api for more information on labelling users.
Fetching scores
Fetch fraud score data for a user via Sift\Client::userScore()
:
This returns an instance of Sift\Score
. Note that if no events have been
captured for the given user, a Sift\Exception\ScoreException
will be thrown.
See https://siftscience.com/docs/getting-scores for more information on fetching user fraud scores.