[BNM] Json API response formats

Tristan Bailey tristanbailey at gmail.com
Fri Jul 24 13:21:02 BST 2015


haze

They are good if they have structure and can be followed by another
developer. There are better choices that have been learned but apis are
still new so there are some good practices but not so much is set in stone
yet as the only way.

https://leanpub.com/build-apis-you-wont-hate
this is phils book if you were interested as covers alot of the pain points.

t

On 24 July 2015 at 13:17, Hazlitt Eastman <hazlitt at manta9.com> wrote:

> Hmm, interesting discussion.
>
> When I write APIs I tend to structure the JSON responses to be as flat as
> possible to make them easy to parse.
>
> Hazlitt
>
>
>
>
> On 24/07/2015 13:02, "BNMlist on behalf of Wayne Douglas" <
> bnmlist-bounces at brightonnewmedia.org on behalf of wayne at sonatribe.com>
> wrote:
>
> >I prefer the JSON API spec: http://jsonapi.org
> >
> >On Fri, 24 Jul 2015 at 12:39, Toby Skinner <toby at globaloptima.co.uk>
> wrote:
> >
> >> On 24/07/2015 12:25, Helana Bryant wrote:
> >> > Any preference?
> >> >
> >> >
> >>
> http://stackoverflow.com/questions/12806386/standard-json-api-response-format
> >>
> >> I like the same sort of approach as the accepted answer: a success
> >> property, a message property for both successful requests (often null in
> >> this case) or errors and a data property for anything call specific like
> >> entity ids or result sets.
> >>
> >> {
> >>      status: true,
> >>      message: null,
> >>      data:null
> >> }
> >>
> >> {
> >>      status: false,
> >>      message: 'error occured',
> >>      data:null
> >> }
> >>
> >> Toby
> >>
> >> --
> >> Toby Skinner
> >>
> >> Director
> >> Global Optima Ltd
> >> Tel 0044 (0) 1273 252904
> >> Tel 0044 (0) 7970 076 226
> >> E-mail toby at globaloptima.co.uk
> >> Web globaloptima.co.uk
> >>
> >> --
> >>
> >> BNM Subscribe/Unsubscribe:
> >> http://www.brightonnewmedia.org/options/bnmlist
> >>
> >> BNM members often work together in the real world at:
> >> http://www.theskiff.org
> >>
> >> BNM powered by Wessex Networks:
> >> http://www.wessexnetworks.com
> >>
> >--
> >
> >BNM Subscribe/Unsubscribe:
> >http://www.brightonnewmedia.org/options/bnmlist
> >
> >BNM members often work together in the real world at:
> http://www.theskiff.org
> >
> >BNM powered by Wessex Networks:
> >http://www.wessexnetworks.com
> --
>
> BNM Subscribe/Unsubscribe:
> http://www.brightonnewmedia.org/options/bnmlist
>
> BNM members often work together in the real world at:
> http://www.theskiff.org
>
> BNM powered by Wessex Networks:
> http://www.wessexnetworks.com
>


More information about the BNMlist mailing list