301 Redirection after starting a build from API

Hello

Since 2 days (25.04.2108) I have an issue in my CI pipeline, when I trigger a build on bitrise via the API it returns a 301 redirect code instead of a success 200 I was receiving before.

curl command:

curl https://www.bitrise.io/app/d58332ab30c627d9/build/start.json --data '{"hook_info":{"type":"bitrise","api_token":""$CI_API_TOKEN""},"build_params":{"branch":"'"$GIT_BRANCH"'","commit_hash":"'"$CI_COMMIT_SHA"'"},"triggered_by":"curl"}'

The response I had (and expect) is:

{"status":"ok","message":"webhook processed","slug":"d58332ab30c627d9","service":"bitrise","build_slug":"8f91d4ff4369aaec","build_number":944,"build_url":"https://www.bitrise.io/build/8f91d4ff4369aaec","triggered_workflow":"dev"}Job succeeded

The response I am getting now is

<html><body>You are being <a href="https://app.bitrise.io/app/d58332ab30c627d9/build/start.json">redirected</a>.</body></html>Job succeeded

What could be the issue - was there a new deployment on bitrise that changed the API or endpoints?

There was an API update - the URL changed https://bitrise.io/app/ from to https://app.bitrise.io/app/

This can be resolved

Indeed, related #announcements post: DEPRECATION of Build Trigger API on 'www' subdomain (use 'app' subdomain or the public API instead)

As noted there, if possible please migrate to the API endpoint instead, that’s a long term supported domain & endpoint, and the API is meant to provide the official public integration point.

If you’d have any questions just let us know! :slight_smile:

You can add the -L (--location) flag to the curl command to follow redirects, that solves the issue as well :slight_smile:

This topic was automatically closed after 14 days. New replies are no longer allowed.