Bilder anlegen
Das Anlegen von Bildern zu einem Entity im EntitySet Products erfolgt über die Methode POST
Listenbild definieren
Request
In dem unteren Beispiel Entity im EntitySet Products mit der Id (1) wird ein Listenbild zugewiesen.
Für die Zuweisung eines Listenbilds muss das Property Type mit 1 übergeben werden.
Request Methode
POST http://sandboxapi.via.de/publicapi/v1/api.svc/ProductImages
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:ProductId>1</d:ProductId>
<d:ImageUrl>http://www.meine-domain.de/standardbild.jpg</d:ImageUrl>
<d:Type>1</d:Type>
</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/ProductImages(1L)</id>
<title type="text"></title>
<updated>2012-08-20T09:26:05Z</updated>
<author>
<name />
</author>
<link rel="edit" title="ProductImage" href="ProductImages(1L)" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Product" type="application/atom+xml;type=entry" title="Product" href="ProductImages(1L)/Product" />
<category term="Via.BlackBox.Entities.ProductImage" 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:ProductId m:type="Edm.Int64">1</d:ProductId>
<d:ImageUrl>http://www.meine-domain.de/listenbild.jpg</d:ImageUrl>
<d:Type m:type="Edm.Int32">1</d:Type>
</m:properties>
</content>
</entry>
Beispiele folgen in Kürze
Angebotsbild anlegen
Request
In dem unteren Beispiel Entity im EntitySet Products mit der Id (1) wird ein Angebotsbild zugewiesen.
Für die Zuweisung eines Angebotsbildes muss das Property Type mit 2 übergeben werden.
Request Methode
POST http://sandboxapi.via.de/publicapi/v1/api.svc/ProductImages
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:ProductId>1</d:ProductId>
<d:ImageUrl>http://www.meine-domain.de/angebotsbild.jpg</d:ImageUrl>
<d:Type>2</d:Type>
</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/ProductImages(1L)</id>
<title type="text"></title>
<updated>2012-08-20T09:26:05Z</updated>
<author>
<name />
</author>
<link rel="edit" title="ProductImage" href="ProductImages(1L)" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Product" type="application/atom+xml;type=entry" title="Product" href="ProductImages(1L)/Product" />
<category term="Via.BlackBox.Entities.ProductImage" 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:ProductId m:type="Edm.Int64">1</d:ProductId>
<d:ImageUrl>http://www.meine-domain.de/angebotsbild.jpg</d:ImageUrl>
<d:Type m:type="Edm.Int32">2</d:Type>
</m:properties>
</content>
</entry>
Beispiele folgen in Kürze
Weitere Bilder definieren
Request
In dem unteren Beispiel Entity im EntitySet Products mit der Id (1) wird ein weiteres Bild zugewiesen.
Für die Zuweisung weiteren Bildern muss das Property Type beginnend mit 3 durchnummeriert werden.
Es sind maximal bis zu 10 weitere Bilder (Nummerierung 3-12) möglich.
Request Methode
POST http://sandboxapi.via.de/publicapi/v1/api.svc/ProductImages
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:ProductId>1</d:ProductId>
<d:ImageUrl>http://www.meine-domain.de/weiteresbild_3.jpg</d:ImageUrl>
<d:Type>3</d:Type>
</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/ProductImages(1L)</id>
<title type="text"></title>
<updated>2012-08-20T09:26:05Z</updated>
<author>
<name />
</author>
<link rel="edit" title="ProductImage" href="ProductImages(1L)" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Product" type="application/atom+xml;type=entry" title="Product" href="ProductImages(1L)/Product" />
<category term="Via.BlackBox.Entities.ProductImage" 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:ProductId m:type="Edm.Int64">1</d:ProductId>
<d:ImageUrl>http://www.meine-domain.de/weiteresbild_3.jpg</d:ImageUrl>
<d:Type m:type="Edm.Int32">3</d:Type>
</m:properties>
</content>
</entry>
Request HTTP-Header
Content-Type: application/json
Accept: application/json
SubscriptionToken: g93af799-6ae8-e111-8406-0050568261dc
Cookie: .ASPXAUTH=0186587E1743637D35632A7EDAF4F07EA67C6E4577770C3778FD9C17904A9D85B01369A8198B23A9AF530DBE93A68687C219BE1876B16B 0DAEBBD2C3318CA6C99D9C53E5B9FE17B7CF9661C5CDDDB97B90D5D3AF550100227EC8D6E6858FAE986AF2302C337B8DFEC6099898C19AA335A81317AB2B382DE72586AA9DF830C715332215AEBFD5E2FBA45F2BB5A7CA9793; path=/; HttpOnly
Request Body
{
"ProductId": "1",
"ImageUrl": "http://www.meine-domain.de/weiteresbild_3.jpg"
"Type": "3"
}
Response
Response HTTP-Header
Status Code: 201 Created
Cache-Control: no-cache
Content-Length: 2154
Content-Type: application/json;charset=utf-8
DataServiceVersion: 1.0;
...
Response Body
{
"d" : {
"__metadata" : {
"uri" : "http://sandboxapi.via.de/PublicApi/v1/Api.svc/ProductImages(3L)",
"type" : "Via.BlackBox.Entities.Api.ProductImage"
},
"Id" : "3",
"ProductId" : "3",
"ImageUrl" : "http://doku.via-ebay.de/bin/download/ColorThemes/ViA%2DeBay/Logo_3.png",
"Type" : 3,
"Product" : {
"__deferred" : {
"uri" : "http://sandboxapi.via.de/PublicApi/v1/Api.svc/ProductImages(3L)/Product"
}
}
}
}
Bild aktualisieren
Beispiele folgen in Kürze
Bild entfernen
Request
In dem unteren Beispiel wird ein Bild mit der Id 3 entfernt.
Request Methode
DELETE http://sandboxapi.via.de/publicapi/v1/api.svc/ProductImages(3L)
Request HTTP-Header
Content-Type: application/atom+xml
SubscriptionToken: g93af799-6ae8-e111-8406-0050568261dc
Cookie: .ASPXAUTH=0186587E1743637D35632A7EDAF4F07EA67C6E4577770C3778FD9C17904A9D85B01369A8198B23A9AF530DBE93A68687C219BE1876B16B 0DAEBBD2C3318CA6C99D9C53E5B9FE17B7CF9661C5CDDDB97B90D5D3AF550100227EC8D6E6858FAE986AF2302C337B8DFEC6099898C19AA335A81317AB2B382DE72586AA9DF830C715332215AEBFD5E2FBA45F2BB5A7CA9793; path=/; HttpOnly