2

I am using the v2.2 api. There is a small issue I have come across.

For the display_name I do not understand the encoding. For example for this user, the name comes as Mike Sherrill 'Cat Recall'

Appears to me as URL encoding. Is there any link which specifies the arguments I should be expecting for different parameter?

1 Answer 1

2

That is not URL encoding, that is HTML entity encoding.

By default, the API returns "safe" values; see the filters doc:

Any string returned as a result of an API call with a safe filter will be inline-able into HTML without script-injection concerns. That is to say, no additional sanitizing (encoding, HTML tag stripping, etc.) will be necessary on returned strings.

That means that special characters (<>'"&, etc.) will be HTML entity encoded by default.

If you run the same query with an "unsafe" filter (See the doc), you can often get the raw values:

{
  "items": [
    {
      ...
      "user_id": 562459,
      ...
      "display_name": "Mike Sherrill 'Cat Recall'",
      ...

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .