From 48c3360e1e248bf9ede2a4dabcdce967312a4fe4 Mon Sep 17 00:00:00 2001 From: hhware Date: Sun, 15 Mar 2015 23:23:03 -0500 Subject: [PATCH] An example of creating relationships together with resource --- format/index.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/format/index.md b/format/index.md index 9f1a0f9c2..4a509b07d 100644 --- a/format/index.md +++ b/format/index.md @@ -908,6 +908,33 @@ Accept: application/vnd.api+json } ``` +Resources can be created together with relationships: + +```text +POST /photos +Content-Type: application/vnd.api+json +Accept: application/vnd.api+json + +{ + "data": { + "type": "photos", + "title": "Ember Hamster", + "src": "http://example.com/images/productivity.png", + "links": { + "author": { + "linkage": { "type": "people", "id": "12" } + }, + "equipment": { + "linkage": [ + { "type": "cameras", "id": "13" }, + { "type": "lenses", "id": "14" } + ] + } + } + } +} +``` + #### Client-Generated IDs A server **MAY** accept a client-generated ID along with a request to create pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy