Based on the search results, Travis CI primarily uses a REST API. Here are the key points about Travis CI's API:
Yes, the official Travis CI API does support webhooks. Travis CI can send webhook notifications about build results.
Webhooks can be configured in the .travis.yml
file of a repository. For example:
notifications: webhooks: http://your-domain.com/notifications
Multiple webhook URLs can be specified:
notifications: webhooks: - http://your-domain.com/notifications - http://another-domain.com/notifications
You can subscribe to the following events for webhook notifications:
on_success
: Sent when a build succeeds (default: always)on_failure
: Sent when a build fails (default: always)on_start
: Sent when a build starts (default: never)on_cancel
: Sent when a build is canceled (default: always)on_error
: Sent when a build errors (default: always)The webhook payload is sent as JSON and includes information about the build status, repository, commit, etc. Some key fields include:
status
/result
: Indicates build status (0 for success, 1 for failure/incomplete)type
: Indicates the event type (push, pull_request, cron, api)Travis CI provides a way to verify webhook requests using a signature header and public key for security.
In addition to webhooks, Travis CI also allows triggering builds via its API. This can be done by sending a POST request to the /repo/{slug|id}/requests
endpoint.
Based on the search results, there is no explicit information provided about the specific API rate limits for the Travis CI API. However, there are a few relevant points to consider regarding API rate limits:
For unauthenticated requests to the GitHub API, the rate limit allows for up to 60 requests per hour ^2.
For authenticated requests using Basic Authentication or OAuth to the GitHub API, you can make up to 5000 requests per hour ^2.
Travis CI uses the GitHub API for various operations, and they have been experiencing issues with hitting GitHub's API rate limits ^5.
In March 2020, Travis CI contacted GitHub to request increases to their API rate limits ^5.
Travis CI has been working on improving how their code accesses the GitHub API to reduce unnecessary calls and stay under the limits ^5.
For Travis CI users, it's recommended to use authenticated requests when possible to benefit from higher rate limits ^2.
If you encounter rate limit issues, Travis CI support suggests retrying the action you were attempting to perform ^5.
For open-source projects using Travis CI, migrating to the Travis CI GitHub Apps integration might help with API limit issues, although this wasn't explicitly mentioned in the support response ^5.
While the specific API rate limits for Travis CI's own API are not provided in the search results, it's clear that Travis CI's operations are significantly impacted by GitHub's API rate limits. Travis CI has been working with GitHub to increase these limits and improve their own API usage to minimize the impact on users.
For the most up-to-date and accurate information on Travis CI's API rate limits, it would be best to consult their official documentation or contact their support directly.
The most recent version of the Travis CI API is V3. Here are the key points:
API V3 is the current and most recent version of the Travis CI API [1].
API V3 was released on April 6, 2017 [2].
It is described as a "discoverable and self-documenting RESTful API" that includes "all the hypermedia features expected from a modern API" [2].
API V3 can be used to automate many Travis CI build processes, including getting build info, restarting builds, canceling builds, triggering debug builds, and more [2].
There is an API Explorer available for V3 that updates automatically when new endpoints are added [2].
To use API V3, you should set the Accept
header to application/vnd.travis-ci.3+json
in your API requests [1].
The previous versions, API V2 and V2.1, are considered deprecated. API V2 was slated for deprecation sometime in 2018 [1].
Documentation for API V3 can be found at https://developer.travis-ci.org.
In summary, API V3 is the current and recommended version of the Travis CI API, offering modern RESTful capabilities and extensive functionality for automating Travis CI processes. When working with the Travis CI API, developers should use V3 and refer to the official documentation and API Explorer for the most up-to-date information on available endpoints and features.
To get a developer account for Travis CI and create an API integration, you can follow these steps:
gem install travis
travis login --pro
travis token
curl -H "Travis-API-Version: 3" \
-H "Authorization: token YOUR_API_TOKEN" \
https://api.travis-ci.com/repos
Based on the search results provided, here is a list of data models that can be interacted with using the Travis CI API, along with what is possible for each:
Key capabilities across these models include:
The API allows programmatic access to most Travis CI functionality available in the web interface, enabling automation of CI/CD workflows and integration with other tools and services.