Character Media Query result structure different per character

Can someone explain to me why the call to character media query results in different json formats depending on which character form the same guild is queried? This is a breaking issue.

Good Result

{
  "_links": { "self": { "href": ".../profile/wow/character/feathermoon/hooka/character-media?namespace=profile-us" } },
  "character": {
    "key": { "href": ".../profile/wow/character/feathermoon/hooka?namespace=profile-us" },
    "name": "Hooka",
    "id": 139454303,
    "realm": {
      "key": { "href": ".../data/wow/realm/118?namespace=dynamic-us" },
      "name": "Feathermoon",
      "id": 118,
      "slug": "feathermoon"
    }
  },
  "avatar_url": ".../character/feathermoon/95/139454303-avatar.jpg",
  "bust_url": ".../character/feathermoon/95/139454303-inset.jpg",
  "render_url": ".../character/feathermoon/95/139454303-main.jpg"
}

** Bad Result**

(Notice the assets property instead of the _url properties)

{
  "_links": { "self": { "href": ".../profile/wow/character/feathermoon/vajraven/character-media?namespace=profile-us" } },
  "character": {
    "key": { "href": ".../profile/wow/character/feathermoon/vajraven?namespace=profile-us" },
    "name": "Vajraven",
    "id": 5280949,
    "realm": {
      "key": { "href": ".../data/wow/realm/118?namespace=dynamic-us" },
      "name": "Feathermoon",
      "id": 118,
      "slug": "feathermoon"
    }
  },
  "assets": [
    {
      "key": "avatar",
      "value": ".../character/feathermoon/181/5280949-avatar.jpg"
    },
    {
      "key": "inset",
      "value": ".../character/feathermoon/181/5280949-inset.jpg"
    },
    {
      "key": "main",
      "value": ".../character/feathermoon/181/5280949-main.jpg"
    },
    {
      "key": "main-raw",
      "value": ".../character/feathermoon/181/5280949-main-raw.png"
    }
  ]
}

The new format is the last one. The change was mentioned in this post.

My guess is the old format is present for characters that did not sign in and out of the game since the last API update this week.

Hi Grimiz,

As suggested by Schiller this is an intended change, and it is expected that some responses will have a different structure than others. Character API documents are re-published on character logout, so characters that have not logged out since the change will have the previous schema.

In the HTTP response, you should see a header as so: Battlenet-Schema-Revision, which denotes the version of the schema returned. For this particular document, the current schema revision is 5.

Battlenet-Schema-Revision: 5

Any document with a Battlenet-Schema-Revision value lower than 5 will represent the structure of the previous schema.

Thanks Schiller and Maguthul for the insight.

Iā€™m still not happy about the breaking changes, (because what api consumer ever is), but I do appreciate your taking time to respond.

1 Like