2017 © Pedro Peláez
 

library somin-api-sdk

SoMin API SDK is a PHP library for making calls to SoMin API.

image

somin-team/somin-api-sdk

SoMin API SDK is a PHP library for making calls to SoMin API.

  • Tuesday, July 10, 2018
  • by somin
  • Repository
  • 3 Watchers
  • 1 Stars
  • 698 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 16 Versions
  • 50 % Grown

The README.md

somin-sdk-php

SoMin API SDK for Somin API is a PHP library for making calls to Somin API. The library enables users for making API calls from PHP 5.6 or high., (*1)

Build Status, (*2)

Example

$requester = new SimpleHttpRequester();
$authorizer = new CredentialsAuthorizer($requester);

$tokenRequest = (new UserCredential())
                        ->setUsername(USERNAME)
                        ->setPassword(PASSWORD);

// Call authorization method
$tokenResponse = $authorizer->auth($tokenRequest);

// Set bearer token to current HttpRequester
$requester->setBearer($tokenResponse->getToken());

$request = (new UserProfileData())
             ->setTexts([
                 "Hello friend!",
                 "The weather is good :)"
             ])
             ->setImageURLs([
                 "https://pbs.twimg.com/media/C6ij4CLUwAAxu9r.jpg",
                 "https://pbs.twimg.com/media/C6jO3UiVoAQYc_8.jpg"
             ])
             ->setLang('en')
             ->withAgeGroup()
             ->withEducationLevel()
             ->withGender()
             ->withIncome()
             ->withOccupation()
             ->withRelationship();

$userProfiler = new IndividualUserProfiler($requester);

// Call individual user profile method and get request id
$requestResponse = $userProfiler->predictIndividualUserProfile($request);

$request = (new ResponseRequest())
            ->setRequestID($requestResponse->getRequestId())
            ->setResponseClass(IndividualUserProfile::class);

// Call method for check current request status
$commonProcessor = new CommonProcessor($this->requester);

$numAttempts = 10;
$response = null;   /** @var $response IndividualUserProfile */

while($numAttempts-- > 0 && ($response == null || $response->getHttpCode() !== 200)) {
    sleep(self::RESPONSE_WAIT_TIME_SECONDS);
    $response = $commonProcessor->response($request);
}

var_dump($response);

Testing

  • Install PHP Unit
  • Set environment variables TEST_USERNAME and TEST_PASSWORD to SoMin API user name and password, respectively.
  • run phpunit in main directory

API Documentation

More information can be found on the SoMin developer web site., (*3)

The Versions

10/07 2018

dev-master

9999999-dev https://github.com/bbridge-team/somin-sdk-php

SoMin API SDK is a PHP library for making calls to SoMin API.

  Sources   Download

Apache-2.0 Apache License 2.0

The Requires

  • php >=5.6.0
  • ext-curl *
  • ext-json *

 

The Development Requires

api social sdk somin multimedia analytics

10/07 2018

1.3.8

1.3.8.0 https://github.com/bbridge-team/somin-sdk-php

SoMin API SDK is a PHP library for making calls to SoMin API.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.6.0
  • ext-curl *
  • ext-json *

 

The Development Requires

api social sdk somin multimedia analytics

06/07 2018

1.3.7

1.3.7.0 https://github.com/bbridge-team/somin-sdk-php

SoMin API SDK is a PHP library for making calls to SoMin API.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.6.0
  • ext-curl *
  • ext-json *

 

The Development Requires

api social sdk somin multimedia analytics

20/04 2018

1.3.2

1.3.2.0 https://github.com/bbridge-team/somin-sdk-php

SoMin API SDK is a PHP library for making calls to SoMin API.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.6.0
  • ext-curl *
  • ext-json *

 

The Development Requires

api social sdk somin multimedia analytics

19/04 2018

1.3.1

1.3.1.0 https://github.com/bbridge-team/somin-sdk-php

SoMin API SDK is a PHP library for making calls to SoMin API.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.6.0
  • ext-curl *
  • ext-json *

 

The Development Requires

api social sdk somin multimedia analytics

18/04 2018

1.3.0

1.3.0.0 https://github.com/bbridge-team/somin-sdk-php

SoMin API SDK is a PHP library for making calls to SoMin API.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.6.0
  • ext-curl *
  • ext-json *

 

The Development Requires

api social sdk somin multimedia analytics

10/04 2018

1.2.7

1.2.7.0 https://github.com/bbridge-team/somin-sdk-php

SoMin API SDK is a PHP library for making calls to SoMin API.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.6.0
  • ext-curl *
  • ext-json *

 

The Development Requires

api social sdk somin multimedia analytics

06/04 2018

1.2.6

1.2.6.0 https://github.com/bbridge-team/somin-sdk-php

SoMin API SDK is a PHP library for making calls to SoMin API.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.6.0
  • ext-curl *
  • ext-json *

 

The Development Requires

api social sdk somin multimedia analytics

04/04 2018

1.2.5

1.2.5.0 https://github.com/bbridge-team/somin-sdk-php

SoMin API SDK is a PHP library for making calls to SoMin API.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.6.0
  • ext-curl *
  • ext-json *

 

The Development Requires

api social sdk somin multimedia analytics

28/03 2018

1.2.4

1.2.4.0 https://github.com/bbridge-team/somin-sdk-php

SoMin API SDK is a PHP library for making calls to SoMin API.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.6.0
  • ext-curl *
  • ext-json *

 

The Development Requires

api social sdk somin multimedia analytics

23/03 2018

1.2.3

1.2.3.0 https://github.com/bbridge-team/somin-sdk-php

SoMin API SDK is a PHP library for making calls to SoMin API.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.6.0
  • ext-curl *
  • ext-json *

 

The Development Requires

api social sdk somin multimedia analytics

19/03 2018

1.2.2

1.2.2.0 https://github.com/bbridge-team/somin-sdk-php

SoMin API SDK is a PHP library for making calls to SoMin API.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.6.0
  • ext-curl *
  • ext-json *

 

The Development Requires

api social sdk somin multimedia analytics

13/03 2018

1.2.1

1.2.1.0 https://github.com/bbridge-team/somin-sdk-php

SoMin API SDK is a PHP library for making calls to SoMin API.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.6.0
  • ext-curl *
  • ext-json *

 

The Development Requires

api social sdk somin multimedia analytics

06/02 2018

1.2

1.2.0.0 https://github.com/bbridge-team/somin-sdk-php

SoMin API SDK is a PHP library for making calls to SoMin API.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.6.0
  • ext-curl *
  • ext-json *

 

The Development Requires

api social sdk somin multimedia analytics

05/02 2018

1.1

1.1.0.0 https://github.com/bbridge-team/somin-sdk-php

SoMin API SDK is a PHP library for making calls to SoMin API.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.6.0
  • ext-curl *
  • ext-json *

 

The Development Requires

api social sdk somin multimedia analytics

05/02 2018

1.0

1.0.0.0 https://github.com/bbridge-team/somin-sdk-php

SoMin API SDK is a PHP library for making calls to SoMin API.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.6.0
  • ext-curl *
  • ext-json *

 

The Development Requires

api social sdk somin multimedia analytics