-
Notifications
You must be signed in to change notification settings - Fork 0
TH_API 2.0 API Endpoints
Nia Mutiara edited this page Feb 28, 2014
·
2 revisions
Hostname: tradehero.mobi
- Categories:
GET /api/news/categories - Countries:
GET /api/news/countries-> country code and language code pair to be used for filtering regional news
- Worldwide:
GET /api/news/global - Country-specific:
GET /api/news/regionalwith paramscountryCode=<country_code>andlanguageCode=<language_code> - My Headlines:
GET /api/news/ofinterest - From social media:
GET /api/news/socialwith paramscategoryId=<category_id>
GET /api/news/<news_id>
Creating:
POST /api/discussions with params
text=<discussion_text>
inReplyToType=replyableType
inReplyToId=replyableId
isPublic=<1/0>
publishToFb=<1/0>
publishToTw=<1/0>
publishToLi=<1/0>
geo_alt=<altitude>
geo_lat=<latitude>
geo_long=<longitude>
Fetching replies:
GET /api/discussions/<replyable_type>/<replyable_id>
Voting:
POST /api/discussions/<replyable_type>/<replyable_id>/vote/<vote_direction>
Sharing:
POST /api/discussions/<replyable_type>/<replyable_id>/share with params socialNetwork = FB|TW|LI
- Timeline Item (on Profile Screen)
- List replies of a timeline item:
GET /api/discussions/timelineitem/<tli_id> - Vote up:
POST /api/discussions/timelineitem/<tli_id>/vote/up - Cancel voting:
POST /api/discussions/timelineitem/<tli_id>/vote/cancel - Sharing: see above
- List replies of a timeline item:
- Security (on Security Screen)
- List discussions of a security:
GET /api/discussions/security/<security_id> - Vote up:
POST /api/discussions/security/<tli_id>/vote/up - Cancel voting:
POST /api/discussions/security/<tli_id>/vote/cancel - Sharing: see above
- List discussions of a security:
- News (on News details Screen)
- List discussions of a news:
GET /api/discussions/news/<news_id> - Vote up:
POST /api/discussions/news/<tli_id>/vote/up - Cancel voting:
POST /api/discussions/news/<tli_id>/vote/cancel - Sharing: see above
- List discussions of a news:
- Replies of a discussion/reply
- List discussions of a discussion/reply:
GET /api/discussions/comment/<comment_id> - Vote up:
POST /api/discussions/comment/<tli_id>/vote/up - Cancel voting:
POST /api/discussions/comment/<tli_id>/vote/cancel - Sharing: see above
- List discussions of a discussion/reply:
- Voice clips & image uploads
- Private messaging
- Push notifications whenever a “subscribed” comment thread is updated
Test account client ID and secret:
#define BING_CLIENT_ID @"12375812376439443957334"
#define BING_SECRET @"PG+2hpZdOYfv7pRRB2YJO+4v4k1+iuh/2bzeg+AurMk="
Bing translate API authentication uses 2-legged OAuth. Get access token first before doing translation requests. The access token has a couple of mins expiry, so actually it can be reused for a while
To get an access token
POST https://datamarket.accesscontrol.windows.net/v2/OAuth2-13 with body params
scope=http://api.microsofttranslator.com
grant_type=client_credentials
client_id=<BING_CLIENT_ID>
client_secret=<BING_SECRET>
To fetch translation
GET http://api.microsofttranslator.com/v2/Http.svc/Translate with header
Authorization: Bearer <access_token>
and params
from=<from_language_code>
to=<to_language_code>
contentType="text/plain"
text=<text_to_translate>
Landscape chart needs an extra param to include the volumes.
Reuters: lowers=volume
Yahoo: a=v