Questions tagged [json-api]

"JSON API" is a standard for building APIs in JSON format. If you've ever argued with your team about the way your JSON responses should be formatted, JSON API is your anti-bikeshedding weapon.

"JSON API" is a standard for building APIs in JSON format. If you've ever argued with your team about the way your JSON responses should be formatted, JSON API is your anti-bikeshedding weapon.

Furthermore, clients built around JSON API are able to take advantage of its features around efficiently caching responses, sometimes eliminating network requests entirely.

By following shared conventions, you can increase productivity, take advantage of generalized tooling, and focus on what matters: your application.

Here's what JSON API (in the ID style) looks like:

{
  "posts": [{
    "id": "1",
    "title": "Rails is Omakase",
    "links": {
      "author": "9",
      "comments": [ "5", "12", "17", "20" ]
    }
  }]
}

and in the URL style:

{
  "posts": [{
    "id": "1",
    "title": "Rails is Omakase",
    "links": {
      "author": "http://example.com/people/9",
      "comments": "http://example.com/comments/5,12,17,20"
    }
  }]
}

JSON API covers creating and updating resources as well, not just responses.

More information can be found on the project's homepage.

636 questions
8
votes
1 answer

EmberJS embedded items in payload JSONAPI

Ember : 1.13.3 Ember Data : 1.13.5 jQuery : 1.11.3 I am trying to send a JSON payload using ember-data from my EmberJS client to my server. I want to send the entire object graph to the server on saving the project, as I don't want to send…
Asagohan
  • 583
  • 4
  • 19
8
votes
3 answers

How do I get the Wordpress JSON-API to work on Nginx server?

For some reason "out-of-the-box" the Wordpress JSON API does not work on Nginx. I have tried several redirect schemes in the nginx conf. The only thing I have gotten to work is ?json. However, this does not work for authentication and…
etrey
  • 389
  • 1
  • 4
  • 12
8
votes
1 answer

Rails 4 Require and Permit Multiple

A long time Java developer - new to ror - I am building a JSON REST API in Rails 4, and I have run into issues using strong parameters. When I perform an HTTP POST request to one of my endpoints, I would like for my controller to require the main…
svarlamov
  • 105
  • 1
  • 9
8
votes
2 answers

Do I need Oauth2 For my Web Apps API

I am trying to wrap my brain around building an express.js / node.js based REST API. I have a couple of questions... Do I NEED token based / oauth 1 or 2 security for my api if I'm only concerned about a web application right now (not necessarily…
Daniel White
  • 3,187
  • 7
  • 37
  • 60
7
votes
1 answer

upload to google cloud store using json api from javascript

I am trying to use gapi to upload an image to google cloud storage.The current code I have is