Using the API for Text Analytics
All input parameters, including the text being analyzed and options, are defined in the request body.
content and contentUri are mutually exclusive; only one can be specified per call.
The text being analyzed can be provided either as a string of text, a file, or the contents of a web page, specified by a URI.
To specify a stirng of text or a file, use the content
parameter:
Processing Local files
This cURL example assumes you have a file input.txt in the directory Users/user with your input data.
Processing URIs
The text or document being analyzed can be contained in a website, accessed through a URI. Processing URI content is supported by submitting contentUri in your requests instead of content.
This procedure is available for all the text analtyics endpoints.
- contentUri must be a valid HTTP, HTTPS, or FTP URL
- Supported MIME types include text and HTML.
- The URL must be publicly accessible from the internet.
- No authentication is supported.
- No cookies or other persistence mechanism is supported.
- Page content (HTML) dynamically generated by JavaScript cannot be downloaded.
- Sites that deny programmatic (without a real browser controlled by an end user) requests cannot be downloaded.