If you need to implement a program in order to access some Twitter's APIs using the application-only authentication, the following will explain how to do it. Also the example shows how to read some Twitts once connected. You can find Twitter's documentation at the address: https://dev.twitter.com/docs/auth/application-only-auth.
For example, you can implement the "user_timeline" API: in order to do this, we need to use the access token as "bearer" instead of the login/password used previously. The new method setAuth (ICobolVar a) of HTTPClient do exactly this. You can also pass all the supported parameters. See https://dev.twitter.com/docs/api/1.1/get/statuses/user_timeline for the full documentation. E.g.:
The two formats returned by the above API are very different: when there is an error the format is very similar to the one already seen above when the authorization fails. If the operation return successfully, however, the payload will be an array of objects, whose length depends on the "count" parameter, each one including about 100 fields (see https://dev.twitter.com/docs/api/1.1/get/statuses/user_timeline for a complete description).
| Copyright (c) 2017 Veryant |
| Contact us |
|
Please share your comments on this manual or on any Veryant product documentation with the email button at the top left |