HTTPS profile and profile background image URLs are being added to user objects

43 views
Skip to first unread message

Matt Harris

unread,
May 16, 2011, 6:27:55 PM5/16/11
to Twitter Development Talk
Hey everyone,

Later this week we'll start to add two new fields to the user object responses from the Streaming and REST APIs (not Search). Due to caching, not all objects will have these fields immediately so you should check they are present in the response before using them.

The two additional fields are the SSL versions of the profile_image_url and the profile_background_image_url. They will be identified in the user object by the attributes:
    profile_image_https
    profile_background_image_url_https

For example, the @twitter user would look similar to this:
{
  "profile_background_tile": false,
  "name": "Twitter",
  "profile_sidebar_fill_color": "F6F6F6",
  "profile_sidebar_border_color": "EEEEEE",
  "location": "San Francisco, CA",
  "created_at": "Tue Feb 20 14:35:54 +0000 2007",
  "id_str": "783214",
  "is_translator": false,
  "profile_link_color": "038543",
  "follow_request_sent": false,
  "default_profile": false,
  "contributors_enabled": true,
  "favourites_count": 10,
  "url": "http://twitter.com",
  "utc_offset": -28800,
  "id": 783214,
  "listed_count": 58963,
  "profile_use_background_image": true,
  "lang": "en",
  "protected": false,
  "profile_text_color": "333333",
  "followers_count": 5063298,
  "notifications": false,
  "geo_enabled": true,
  "verified": true,
  "profile_background_color": "ACDED6",
  "profile_background_image_url_https": "https://si2.twimg.com/images/themes/theme18/bg.gif",
  "description": "Always wondering what's happening. ",
  "time_zone": "Pacific Time (US & Canada)",
  "statuses_count": 1111,
  "friends_count": 487,
  "default_profile_image": false,
  "profile_background_image_url": "http://a1.twimg.com/images/themes/theme18/bg.gif",
  "status": {
    "coordinates": null,
    "created_at": "Mon May 16 17:23:59 +0000 2011",
    "truncated": false,
    "favorited": false,
    "id_str": "70177690392592384",
    "in_reply_to_user_id_str": null,
    "text": "Remember in 2009 when @aplusk and @cnn were racing to be the 1st to reach a million followers? @ladygaga just reached 10 million. Wow!",
    "annotations": null,
    "contributors": [
      16739704
    ],
    "id": 70177690392592384,
    "retweet_count": "100+",
    "in_reply_to_status_id_str": null,
    "geo": null,
    "retweeted": false,
    "in_reply_to_user_id": null,
    "in_reply_to_screen_name": null,
    "source": "web",
    "place": null,
    "in_reply_to_status_id": null
  },
  "screen_name": "twitter",
  "show_all_inline_media": true,
  "following": true
}

Best,
@themattharris
Developer Advocate, Twitter
http://twitter.com/themattharris

themattharris

unread,
May 16, 2011, 8:46:57 PM5/16/11
to Twitter Development Talk
Just to follow up on this, the correct additional fields are:
profile_image_url_https
profile_background_image_url_https

The original email missed the _url in profile_image_url_https.

Best
@themattharris

Shachar

unread,
May 17, 2011, 1:11:46 AM5/17/11
to Twitter Development Talk
Hi Matt,

Thanks for the update.

Is there any plan to add these fields to the search API results?

-- Shachar

Terence Eden

unread,
May 17, 2011, 6:51:30 AM5/17/11
to Twitter Development Talk
Thank for implementing my suggestion ;-) (http://shkspr.mobi/blog/
index.php/2011/05/a-minor-twitter-privacy-bug/)
A quick question. Why add a new field? Why not use the existing one
IFF the request came over HTTPS?

Taylor Singletary

unread,
May 17, 2011, 10:33:17 AM5/17/11
to twitter-deve...@googlegroups.com
Developers may choose to use the API in SSL but serve their websites without encryption. Not all uses of the API are in a web context. This allows a developer to choose the image most appropriate for their end-user's scenario whether they are connected to the API using SSL or otherwise. Better to make its usage a deliberate decision on the developer's part.

@episod - Taylor Singletary


> Developer Advocate, Twitterhttp://twitter.com/themattharris

--
Twitter developer documentation and resources: https://dev.twitter.com/doc
API updates via Twitter: https://twitter.com/twitterapi
Issues/Enhancements Tracker: https://code.google.com/p/twitter-api/issues/list
Change your membership to this group: https://groups.google.com/forum/#!forum/twitter-development-talk

Reply all
Reply to author
Forward
0 new messages