Watson Analytics

Live

Watson Analytics

+ Day(s) remaining in the trial

Overview

IBM Watson Analytics is a smart data discovery service that lets you discover patterns and meanings in your data from the cloud. It guides data exploration, automates predictive analytics, and enables effortless dashboard and infographic creation so you can get answers and new insights to make confident decisions in minutes. The IBM Watson Analytics APIs allow partners and customers to develop integrated applications.

Getting started

What Do I Need To Do?

For more info about the Watson Analytics API, see the Watson Analytics Developer Center.

For info on how to get started with the IBM Watson Analytics API, go to the Tutorial in the Developer Center. A new window opens. Keep your API Explorer window open as well.

To see sample code that uses the Watson Analytics API, visit us on GitHub.

Rate limiting

The Watson Analytics API Trial plan is restricted to 100 requests per hour. If your applications exceed this limit, you will receive HTTP error 429: { "httpCode": "429", "httpMessage": "Too Many Requests", "moreInformation": "Rate Limit exceeded" } To solve this problem, acquire another Watson Analytics API plan with a greater rate limit.

Security

Keys

Pick a key to use with this API. Make sure you are logged in with your IBM id for your keys to be populated in the dropdown below. By selecting a key, it will be pre-filled for each endpoint in the Documentation section that can be used with the built-in testing. If you want to change which key to use for a particular endpoint, you can do so at the endpoint in the Documentation section.
You can manage your API keys in the <MyAPIs> section. API keys authenticate you to your subscription, so make sure to keep them secret. Do not share the X-IBM-Client-Secret portion of any API key in publicly accessible places such as GitHub, or client-side code.



Manage your keys
 

1. Registration API

1. Register client configuration
Use the /oauth2/v1/config operation to register your application's information in Watson Analytics. You only need to call this operation once unless the client ID changes.

PUT   /oauth2/v1/config

			https://api.ibm.com/watsonanalytics/run/oauth2/v1/config
		
Keys
Header parameters

X-IBM-Client-Secret

HEADER , required

The client secret associated with your application.

X-IBM-Client-Id

HEADER , required

The client ID associated with your application.

X-IBM-WA-Data-Center

HEADER , optional

The data center that your application works on. Only required for the Asia-Pacific (ap1), European (eu1), and United States (us1) data centers. If this parameter is not included, the default data center is reached (watson.analytics.ibmcloud.com).

Request code
								
var client = new RestClient("https://api.ibm.com/watsonanalytics/run/oauth2/v1/config"); var request = new RestRequest(Method.PUT); request.AddHeader("content-type", "application/json"); request.AddHeader("accept", "application/json"); request.AddHeader("x-ibm-wa-data-center", "string"); request.AddHeader("x-ibm-client-id", "string"); request.AddHeader("x-ibm-client-secret", "string"); request.AddParameter("application/json", "{\"clientName\":\"\",\"ownerCompany\":\"\",\"ownerEmail\":\"\",\"ownerName\":\"\",\"ownerPhone\":\"\",\"redirectURIs\":\"\"}", ParameterType.RequestBody); IRestResponse response = client.Execute(request);
Request model

clientName

STRING , required

The name of the client. If a clientName is already in use by another application, a 409 response is returned and you must select another clientName.

redirectURIs

STRING , required

The callback entry point of the application. This parameter specifies a URI or list of URIs separated by spaces for each application that you want the Watson Analytics API to redirect to. Do not use 'localhost' as the redirect URI.

ownerName

STRING , required

The name of the owner.

ownerEmail

STRING , required

The owner's email address.

ownerCompany

STRING , required

The name of the company.

ownerPhone

STRING , required

The phone number of the owner.

Request example
{
    "ownerName": "John Smith",
    "clientName": "The Sample Outdoors Company",
    "redirectURIs": "https://callback.example.com:5443",
    "ownerPhone": "555-123-4567",
    "ownerCompany": "The Sample Outdoors Company",
    "ownerEmail": "John.Smith@example.com"
}
Response model

200

Success

Body

ownerName

STRING , optional

The name of the owner of the application. Not the end user.

accessTokenLifeTime

INTEGER , optional

Access token validity period in seconds. Default value is 3600 seconds (1 hour). Access token can be renewed by using a refresh token.

grantType

STRING , optional

nteraction type by which partner application receives access token. The value is authorization_code for user consent flow.

clientName

STRING , optional

Name of application.

partnerId

STRING , optional

Internal use only.

redirectURIs

STRING , optional

The callback entry point of the application. This parameter specifies a list of URIs separated by spaces for each application that you want the Watson Analytics redirect to deliver authorization code.

ownerPhone

STRING , optional

Phone number of the owner of the application.

allowedScopes

STRING , optional

Represents the scope of the access request. The value is set to userContext. The access token that is returned by the server will have access to only those services mentioned in the scope.

ownerCompany

STRING , optional

Name of the company that owns the application.

ownerEmail

STRING , optional

Email address of the owner of the application.

clientId

STRING , optional

Client ID of the application. This is part of API Key.

400

Bad Request

Body

message

STRING , optional

The error message for the end user of your application.

developer

STRING , optional

The error message for the developer of your application.

code

STRING , optional

The response code.

401

Unauthorized

Body

message

STRING , optional

The error message for the end user of your application.

developer

STRING , optional

The error message for the developer of your application.

code

STRING , optional

The response code.

409

Conflict

Body

message

STRING , optional

The error message for the end user of your application.

developer

STRING , optional

The error message for the developer of your application.

code

STRING , optional

The response code.

500

Internal Server Error

Body

message

STRING , optional

The error message for the end user of your application.

developer

STRING , optional

The error message for the developer of your application.

code

STRING , optional

The response code.

Response example

200

Success

								{
  "ownerName": "John Smith",
  "accessTokenLifeTime": 3600,
  "grantType": "authorization_code client_credentials password",
  "partnerId": "BA8NU7CNRVJ9",
  "redirectURIs": "https://callback1.example.com:5443 https://callback2.example.com:5443",
  "ownerCompany": "The Sample Outdoors Company",
  "clientId": "999d686e-9988-4b31-8470-5fb0d49c00fe",
  "clientName": "The Sample Outdoors Company",
  "allowedScopes": "userContext partnerProfile",
  "ownerPhone": "555-123-4567",
  "ownerEmail": "John.Smith@example.com"
}
							

400

Bad Request

								{
  "code": "The response code.",
  "message": "The error message for the end user of your application.",
  "developer": "The error message for the developer of your application."
}

							

401

Unauthorized

								{
  "code": "The response code.",
  "message": "The error message for the end user of your application.",
  "developer": "The error message for the developer of your application."
}

							

409

Conflict

								{
  "code": "conflict",
  "message": "The operation 'PUT /config' failed since the specified clientName is already in use by another application. Please specify a different clientName to associate with your application.",
  "developer": "The clientName is already in use by another application."
}
							

500

Internal Server Error

								{
  "code": "The response code.",
  "message": "The error message for the end user of your application.",
  "developer": "The error message for the developer of your application."
}

							
2. Get client configuration
This operation returns the configuration for the specified client.

GET   /oauth2/v1/config

			https://api.ibm.com/watsonanalytics/run/oauth2/v1/config
		
Keys
Header parameters

X-IBM-Client-Secret

HEADER , required

The client secret you use for your applications.

X-IBM-Client-Id

HEADER , required

The client ID you use for your applications.

X-IBM-WA-Data-Center

HEADER , optional

The data center that your application works on. Only required for the Asia-Pacific (ap1), European (eu1), and United States (us1) data centers. If this parameter is not included, the default data center is reached (watson.analytics.ibmcloud.com).

Request code
								
var client = new RestClient("https://api.ibm.com/watsonanalytics/run/oauth2/v1/config"); var request = new RestRequest(Method.GET); request.AddHeader("accept", "application/json"); request.AddHeader("x-ibm-client-id", "string"); request.AddHeader("x-ibm-client-secret", "string"); request.AddHeader("x-ibm-wa-data-center", "string"); IRestResponse response = client.Execute(request);
Response model

200

Success

Body

ownerName

STRING , optional

The name of the owner of the application. Not the end user.

accessTokenLifeTime

INTEGER , optional

Access token validity period in seconds. Default value is 3600 seconds (1 hour). Access token can be renewed by using a refresh token.

grantType

STRING , optional

Interaction type by which partner application receives access token. The value is authorization_code for user consent flow.

clientName

STRING , optional

Name of the application.

partnerId

STRING , optional

Internal use only.

redirectURIs

STRING , optional

The callback entry point of the application. This parameter specifies a list of URIs separated by spaces for each application that you want the Watson Analytics redirect to deliver authorization code.

ownerPhone

STRING , optional

Phone number of the owner of the application

allowedScopes

STRING , optional

This value represents the scope of the access request. The value is set as userContext. The access token that is returned by the server will have access to only those services mentioned in the scope.

ownerCompany

STRING , optional

Name of the company that owns the application.

ownerEmail

STRING , optional

Email address of the owner of the application.

clientId

STRING , optional

Client ID of the application. This is part of API key.

400

Bad Request

Body

message

STRING , optional

The error message for the end user of your application.

developer

STRING , optional

The error message for the developer of your application.

code

STRING , optional

The response code.

401

Unauthorized

Body

message

STRING , optional

The error message for the end user of your application.

developer

STRING , optional

The error message for the developer of your application.

code

STRING , optional

The response code.

409

Conflict

Body

message

STRING , optional

The error message for the end user of your application.

developer

STRING , optional

The error message for the developer of your application.

code

STRING , optional

The response code.

500

Internal Server Error

Body

message

STRING , optional

The error message for the end user of your application.

developer

STRING , optional

The error message for the developer of your application.

code

STRING , optional

The response code.

Response example

200

Success

								{
  "enabled": true,
  "ownerName": "John Smith",
  "accessTokenLifeTime": 3600,
  "grantType": "authorization_code client_credentials password",
  "partnerId": "CD8MN7CNRVK0",
  "redirectURIs": "https://callback1.example.com:5443 https://callback2.example.com:5443",
  "tokenRefreshCount": 0,
  "ownerCompany": "The Sample Outdoors Company",
  "clientId": "111d2326e-6677-4b31-8470-5fb0d49c00fi",
  "source": "APIm",
  "clientName": "The Sample Outdoors Company",
  "refreshTokenLifeTime": 3600,
  "allowedScopes": "userContext partnerProfile",
  "ownerPhone": "555-123-4567",
  "ownerEmail": "John.Smith@example.com"
}
							

400

Bad Request

								{
  "code": "Error return code",
  "message": "Error message text intended for an end user",
  "developer": "Error message text intended for a developer"
}
							

401

Unauthorized

								{
  "code": "The response code.",
  "message": "The error message for the end user of your application.",
  "developer": "The error message for the developer of your application."
}
							

409

Conflict

								{
  "code": "conflict",
  "message": "The operation 'PUT /config' failed since the specified clientName is already in use by another application. Please specify a different clientName to associate with your application.",
  "developer": "The clientName is already in use by another application."
}
							

500

Internal Server Error

								{
  "code": "The response code.",
  "message": "The error message for the end user of your application.",
  "developer": "The error message for the developer of your application."
}
							

Loading content...