Skip to content

Instantly share code, notes, and snippets.

@krainboltgreene
Last active August 29, 2015 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krainboltgreene/164aba8b103bf9772cad to your computer and use it in GitHub Desktop.
Save krainboltgreene/164aba8b103bf9772cad to your computer and use it in GitHub Desktop.
GET /accounts?fields=name&include=organizations
{
"accounts": [
{
"id": "1",
"name": "Kurtis Rainbolt-Greene",
"href": "http://api.endorsemint.com/accounts/1",
"links": {
"fundings": "http://api.endorsemint.com/fundings/?accounts=1",
"organizations": "http://api.endorsemint.com/organizations/?accounts=1"
},
"linked": {
"organizations": [
{
"id": "3",
"href": "http://api.endorsemint.com/organizations/3"
}
]
},
"meta": {}
}
],
"links": {},
"linked": {},
"meta": {
"request": {
"include": [
"organizations"
],
"fields": [
"id",
"name",
"href"
]
}
}
}
@dgeb
Copy link

dgeb commented Nov 12, 2014

Under the current spec, the following would be compliant:

{
  "accounts": [
    {
      "id": "1",
      "name": "Kurtis Rainbolt-Greene",
      "href": "http://api.endorsemint.com/accounts/1",
      "links": {
        "fundings": {
          "href": "http://api.endorsemint.com/fundings/?accounts=1"
        },
        "organizations": {
          "ids": ["3"],
          "href": "http://api.endorsemint.com/organizations/?accounts=1"
        }
      }
    }
  ],
  "linked": {
    "organizations": [
      {
        "id": "3",
        "href": "http://api.endorsemint.com/organizations/3"
      }
    ]
  },
  "meta": {
    "request": {
      "include": [
        "organizations"
      ],
      "fields": [
        "id",
        "name",
        "href"
      ]
    }
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment