Client library to use the IBM Watson Services

This package's canonical repository appears to be gone and the package has been frozen as a result.


README

The PHP SDK uses the Watson Developer Cloud services, a collection of REST APIs and SDKs that use cognitive computing to solve complex problems.

Table of Contents

Installation

Composer

All the services:

'composer require watson-developer-cloud/php-sdk'

or

Add require to your project composer.json file

{
    "require": {
        "watson-developer-cloud/php-sdk": "^5.0"
    }
}

Usage

The examples within each service assume that you already have service credentials. If not, you will have to create a service in Bluemix.

If you are running your application in Bluemix, you don't need to specify the credentials; the library will get them for you by looking at the VCAP_SERVICES environment variable.

Getting the Service Credentials

You will need the username and password (api_key for Discovery API) credentials for each service. Service credentials are different from your Bluemix account username and password.

To get your service credentials, follow these steps:

  1. Log in to Bluemix at https://bluemix.net.

  2. Create an instance of the service:

    1. In the Bluemix Catalog, select the service you want to use.
    2. Under Add Service, type a unique name for the service instance in the Service name field. For example, type my-service-name. Leave the default values for the other options.
    3. Click Create.
  3. Copy your credentials:

    1. On the left side of the page, click Service Credentials to view your service credentials.
    2. Copy username and password(api_key for Discovery API).

Once you have credentials, copy config.properties.example to src/test/resources/config.properties, and fill them in as necessary.

Questions

If you are having difficulties using the APIs or you have a question about the IBM Watson Services, please ask a question on dW Answers or Stack Overflow.

License

This library is licensed under Apache 2.0. Full license text is available in LICENSE.