How do I get a user slug from a user name?

I’m trying to migrate this code to the new apps for org endpoint.

fun getAppsForOrg(orgName: String = getEnv("BITRISE_ORG")): List<BitriseAppObject> {
    val appsList = ArrayList<BitriseAppObject>()
    var response: Response<BitriseAppData>
    var next: String? = ""

    while (next != null) {
        response = apiService.getApps(next).execute()
        appsList.addAll(response.body().data)
        next = response.body().paging.next
    }

    return appsList.filter { orgName == it.repo_owner }
}

GET https://api.bitrise.io/v0.1/users/instructure/builds/ does not work. Is there an API for converting a user name to a user slug?

I’m expecting GET /organizations to exist. That would return a list of all the associated orgs for the authenticated user.

1 Like

That’s definitely planned and on our roadmap, we’ll try to schedule it as soon as possible :wink:

1 Like

Hey @bootstraponline,

We’ve release the /organizations endpoint in the Bitrise API, here you can find some information of the new endpoint.

Happy building :muscle: :wink:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.