'title' & 'description' fields returned by API 'get goal' request

Hello!

I’ve been playing around with the ‘get all goals’ API endpoint at /u/[user]/goals.json

The returned values for ‘title’ & ‘description’ are a bit confusing:

  • ‘title’ is set to what you put in as description under the goal settings
  • ‘description’ seems to be always null

I was actually hoping to retrieve the goal ‘fine print’ - could we put that inside the ‘description’ field, or add a new field? Does ‘description’ ever contain something useful?

[Background: I was looking to “tag” my goals by adding certain keywords to the fine print, and use those tags to implement custom behaviour. It can make it work by putting the tags as goal description, but then that messes up the display in the iPhone app, which uses the description as the main name for the goals.]

Thanks!

2 Likes

Thanks for pointing this out! That’s a somewhat embarrassing vestige of the Great Goalname/Slug/Description Debacle of 2016 (don’t ask). Your interpretation is correct, the backend’s title field is where we store the thing that is referred to in the UI as the description.

It’s a little too complex to change without going to a full v2 of the API. However, we do now (as of five minutes ago) return the fineprint field in the goal JSON!

And thanks for the reminder about the iPhone app using descriptions. I’ll have to think about how we can gracefully transition that as well.

2 Likes

Hi @apb,

thanks so much for adding the fineprint field so quickly! I’ve tested it, and it works as expected.

Now I can have tags on my goals without cluttering the display of the iPhone app, yay! :raised_hands:

3 Likes