synthesis
12 years agoGuide
How do you derive a post URL from the information contained in a API call?
I have a API call:
That returns this JSON:
{"response":{"status":"success","messages":{"message":[{"type":"message","href":"\/messages\/id\/2928261","id":{"type":"int","$":2928261},"read_only":{"type":"boolean","$":false},"root":{"type":"message","href":"\/messages\/id\/2928043"},"parent":{"type":"message","href":"\/messages\/id\/2928043"},"teaser":{"type":"string","$":""},"views":{"count":{"type":"int","$":0}},"board_id":{"type":"int","$":48746},"author":{"type":"user","href":"\/users\/id\/18563","login":{"type":"string","$":"banhien"}},"deleted":{"type":"boolean","$":false},"subject":{"type":"string","$":"Re: Deskjet 3050"},"board":{"type":"board","href":"\/boards\/id\/Software"},"body":{"type":"string","$":"<P>Hi,<\/P><P> <\/P><P>Please download the following Software and Drivers then install to your Windows 7 computer:<\/P><P> <\/P><P> <A target=\"_blank\" href=\"http:\/\/ftp.hp.com\/pub\/softlib\/software12\/COL34584\/al-109394-2\/DJ3050_J610_1315.exe\">http:\/\/ftp.hp.com\/pub\/softlib\/software12\/COL34584\/al-109394-2\/DJ3050_J610_1315.exe<\/A><\/P><P> <\/P><P>Regards.<\/P>"},"thread":{"type":"thread","href":"\/threads\/id\/2928043"},"message_rating":{"type":"float","$":0.0},"last_edit_author":{"type":"user","href":"\/users\/id\/18563","login":{"type":"string","$":"banhien"}},"kudos":{"count":{"type":"int","$":0}},"last_edit_time":{"type":"date_time","$":"2013-09-11T20:59:58+00:00"},"post_time":{"type":"date_time","$":"2013-09-11T20:59:58+00:00"}}]}}}
How do I construct a valid URL from this data that a user could click on and it would take them to the forum post? I see that I have the "Message" and "Thread" IDs, but I can't figure out how to turn them into a "http:\\" address.
Can anyone help?
Thank you!
Found it. Here is the answer:
Juse use the "restapi.response_style=view" option.