1

I have a github action that deploys a review app using the platform api, which then returns the review app id: https://devcenter.heroku.com/articles/platform-api-reference#review-app-create

Now I need to obtain the review app name (or url) from the id and I'm not seeing how that can be done through the Platform API. The name does get assigned to a config var in the review app (HEROKU_APP_NAME) but I'm also unable to see how to access config vars using the review app id (I know they can be accessed with heroku config:get -a [review app name] - gotta love those catch 22s ).

opike
  • 7,053
  • 14
  • 68
  • 95
  • Why don't you parse the output to get the URL? – soltex Feb 28 '21 at 11:50
  • Specifically which output? – opike Feb 28 '21 at 12:27
  • 1
    Oh, you got me! That one is tricky. Did you try using an URL pattern? https://devcenter.heroku.com/articles/github-integration-review-apps#selecting-the-url-pattern – soltex Feb 28 '21 at 13:14
  • 2
    I suppose that's an indirect way of achieving my goal - establish a predictable pattern and use the same logic in the client api program to construct the url. It's still odd that this value isn't directly accessible through the api since one would expect this to be one of the most desired properties of a review app. – opike Feb 28 '21 at 16:50

1 Answers1

2

It's not intuitive, but the app attribute on the review app resource contains an ID, and so the review apps reference an associated "app" resource. Sending the app ID to the /app endpoint will return web_url as one of its attributes.

https://devcenter.heroku.com/articles/platform-api-reference#app

Dharman
  • 30,962
  • 25
  • 85
  • 135
Sam
  • 21
  • 2