Re: [guardian-api-talk] Does the API return the link provided in SendToAFriend (i.e. Email)?

26 views
Skip to first unread message

Michael Brunton-Spall

unread,
Sep 6, 2012, 4:19:03 AM9/6/12
to guardian...@googlegroups.com

If you add show-fields=shortUrl to the query, you'll get back a field with the shortened URL for each piece of content.

On Sep 6, 2012 9:03 AM, "davidalis" <david...@gmail.com> wrote:
How do I use the API so that it returns also returns the link provided in SendToAFriend (i.e. Email button)
 
This is what the ContentAPI explorer returns for:"The era of cheap food may be over"
http://content.guardianapis.com/search?q=The+era+of+cheap+food+may+be+over&from-date=2012-09-02&to-date=2012-09-02&order-by=relevance&format=json&date-id=date%2Flast7days&api-key=(myKey)

the link shown in the SendToAFriend email is this
 http://gu.com/p/3a622/em

david

--
You received this message because you are subscribed to the Google Groups "Guardian API Talk" group.
To view this discussion on the web, visit https://groups.google.com/d/msg/guardian-api-talk/-/Yw9D0W_kqxwJ.
To post to this group, send an email to guardian...@googlegroups.com.
To unsubscribe from this group, send email to guardian-api-t...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/guardian-api-talk?hl=en-GB.
Please consider the environment before printing this email.
------------------------------------------------------------------
Visit guardian.co.uk - newspaper of the year

www.guardian.co.uk    www.observer.co.uk     www.guardiannews.com 

On your mobile, visit m.guardian.co.uk or download the Guardian
iPhone app www.guardian.co.uk/iphone and iPad edition www.guardian.co.uk/iPad 
 
Save up to 37% by subscribing to the Guardian and Observer - choose the papers you want and get full digital access. 
Visit guardian.co.uk/subscribe 

---------------------------------------------------------------------
This e-mail and all attachments are confidential and may also
be privileged. If you are not the named recipient, please notify
the sender and delete the e-mail and all attachments immediately.
Do not disclose the contents to another person. You may not use
the information for any purpose, or store, or copy, it in any way.
 
Guardian News & Media Limited is not liable for any computer
viruses or other material transmitted with or as part of this
e-mail. You should employ virus checking software.

Guardian News & Media Limited

A member of Guardian Media Group plc
Registered Office
PO Box 68164
Kings Place
90 York Way
London
N1P 2AP

Registered in England Number 908396

davidalis

unread,
Sep 6, 2012, 7:11:02 AM9/6/12
to guardian...@googlegroups.com
Mmmm...

Results

Error: requested show-fields invalid: =shortUrl

Michael Brunton-Spall

unread,
Sep 6, 2012, 7:37:17 AM9/6/12
to guardian...@googlegroups.com
http://content.guardianapis.com/search?q=Cameron+unveils+planning+reforms+&format=json&show-fields=shortUrl&api-key=(mykey) 
returns valid json for me, as does 
for me.

I did write the original on my phone on the train, so couldn't check, but those urls above should definitely be working for you.

Michael Brunton-Spall
Developer Advocate
guardian.co.uk


To view this discussion on the web, visit https://groups.google.com/d/msg/guardian-api-talk/-/qUJ2f4-4ETcJ.

davidalis

unread,
Sep 6, 2012, 8:15:14 AM9/6/12
to guardian...@googlegroups.com
You're right - the query does return what I wanted.
 
The problem seems to be with the explorer - http://explorer.content.guardianapis.com
 
Thanks
David
Reply all
Reply to author
Forward
0 new messages