VIA-Connect - REST API » ProductRelations » ProductRelations - Beispiele

ProductRelations - Beispiele

Zuletzt geändert von Thomas Hoffmann am 2014/04/14 16:56
Kommentare (0) · Anhänge (0) · Historie

Relation anlegen

Request

In dem unteren Beispiel wird einem Produktset mit der Id (5) (ParentId) ein Einzelprodukt mit Spezifikationen mit der Id (1) (ChildId) zugewiesen.

Request Methode


POST                    http://sandboxapi.via.de/publicapi/v1/api.svc/ProductRelations

Request HTTP-Header


Content-Type:           application/atom+xml
SubscriptionToken:      g93af799-6ae8-e111-8406-0050568261dc
Cookie:                 .ASPXAUTH=0186587E1743637D35632A7EDAF4F07EA67C6E4577770C3778FD9C17904A9D85B01369A8198B23A9AF530DBE93A68687C219BE1876B16B 0DAEBBD2C3318CA6C99D9C53E5B9FE17B7CF9661C5CDDDB97B90D5D3AF550100227EC8D6E6858FAE986AF2302C337B8DFEC6099898C19AA335A81317AB2B382DE72586AA9DF830C715332215AEBFD5E2FBA45F2BB5A7CA9793; path=/; HttpOnly

Request Body


<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<entry xml:base="http://sandboxapi.via.de/publicapi/v1/api.svc/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom">
   <content type="application/xml">
       <m:properties>
           <d:ParentId>5</d:ParentId>
           <d:ChildId>1</d:ChildId>
       </m:properties>
   </content>    
</entry>

Response

Response HTTP-Header


Status Code:            201 Created
Cache-Control:          no-cache
Content-Length:         2154
Content-Type:           application/atom+xml;charset=utf-8
DataServiceVersion:     1.0;
...

Response Body


<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<entry xml:base="http://sandboxapi.via.de/publicapi/v1/api.svc/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom">
   <id>http://sandboxapi.via.de/publicapi/v1/api.svc/ProductRelations(1L)</id>
   <title type="text"></title>
   <updated>2012-08-20T09:50:36Z</updated>
   <author>
       <name />
   </author>
   <link rel="edit" title="ProductRelation" href="ProductRelations(1L)" />
   <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ChildProduct" type="application/atom+xml;type=entry" title="ChildProduct" href="ProductRelations(1L)/ChildProduct" />
   <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ParentProduct" type="application/atom+xml;type=entry" title="ParentProduct" href="ProductRelations(1L)/ParentProduct" />
   <category term="Via.BlackBox.Entities.ProductRelation" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
   <content type="application/xml">
       <m:properties>
       <d:Id m:type="Edm.Int64">1</d:Id>
       <d:ParentId m:type="Edm.Int64">5</d:ParentId>
       <d:ChildId m:type="Edm.Int64">1</d:ChildId>
       </m:properties>
   </content>
</entry>

Beispiele folgen in Kürze
 
Ein Einzelprodukt (Child) kann mehreren Produktsets (Parent) zugewiesen sein.
Tags:
Erstellt von Thomas Hoffmann am 2012/08/20 15:43

Copyright 2004-2023 XWiki