watson-developer-cloud / php-sdk
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.
This package is not auto-updated.
Last update: 2020-08-08 05:39:26 UTC
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
- Usage
- Getting the Service Credentials
- Questions
- IBM Watson Services
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:
-
Log in to Bluemix at https://bluemix.net.
-
Create an instance of the service:
- In the Bluemix Catalog, select the service you want to use.
- 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. - Click Create.
-
Copy your credentials:
- On the left side of the page, click Service Credentials to view your service credentials.
- Copy
username
andpassword
(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.