VIA-Connect - REST API » EntitySets

EntitySets

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

Beschreibung

Ein EntitySet ist eine Zusammenfassung von mehreren vergleichbaren Entities.

Jedes EntitySet hat eine eindeutige Bezeichnung (z.B. Products, SalesOrders) und besitzt mehrere Properties.

Alle EntitySets haben Navigation Properties zu einem anderen EntitySet.

Die EntitySets können mit HTTP Request Methoden (GET, POST usw.) angesprochen werden.

EntitySet Navigation PropertyRequest Methoden 
Catalogs  ChildCatalogs
 ParentCatalogs
 Products
 GET / POST /  PUT / DELETE
Products  ProductImages
 ProductSpecifics
 ChildProduct
 
ParentProduct
 Catalogs
 GET / POST /  PUT / DELETE
- ProductImages  Product GET / POST /  PUT / DELETE
- ProductSpecifics  Product GET / POST /  PUT / DELETE
- ProductRelations  ChildProduct
 ParentProduct
 GET / POST /  PUT / DELETE
- Listings ListingsItems
 Product
 GET
- ListingItems Listing
 Product
 GET
SalesOrders SalesOrderItems
 SalesOrderHistories
 Buyer
 Address
 ShippingAdress
 GET / PUT
- SalesOrderItems SalesOrder GET / PUT
- Addresses Buyer
 SalesOrders
 ShippingSalesOrders
 GET
- Buyers Addresses
 SalesOrders
 GET

 

Alle Entitysets haben das Property Id und darüber wird jedes Entity im jeweiligen EntitySet identifiziert.

Schema

Mit Klick auf das Bild finden Sie eine Übersicht der Entities der VIA API.

API-EntitySet-Schema_3.png

Navigation Properties

Die Navigation Properties bilden die Assoziationen zu einem anderen EntitySets.

Damit können die Properties von einem assoziiertem EntitySet abgerufen werden.

Syntax


GET                     http://sandboxapi.via.de/publicapi/v1/api.svc/{EntitySet}({Id}L)/{NavigationProperty}

  • {EntitySet}
    Enthält die Bezeichnung eines EntitySets (z.B. SalesOrders)
  • {Id}
    Enthält die Id des Entity aus dem entsprechenden EntitySet
  • {NavigationProperty}
    Enthält die Bezeichnung des Navigation Property

Beispiel

Im unteren Beispiel wird das Entity mit der Id 1 vom EntitySet Salesorders das assoziierte EntitySet Addresses mit dem Navigation Property Address (Rechnungsadresse) abgerufen:


GET                     http://sandboxapi.via.de/publicapi/v1/api.svc/SalesOrders(1L)/Address

Request Methoden

Methode Erläuterung 
GET Entity lesen
POST Entity anlegen
PUT Property/Entity aktualisieren
DELETE Entity löschen

Besonderheiten

Die API verwendet für das Property Id den Datentyp Int64.

Daher muss bei den Methoden GET, PUT und DELETE darauf geachtet werden, dass zusätzlich zu der Id noch das Typenkürzel L (Long) angehängt wird.

Beispiele für Request Methoden


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

GET                http://sandboxapi.via.de/publicapi/v1/api.svc/Products(1L)

PUT                http://sandboxapi.via.de/publicapi/v1/api.svc/Products(1L)

DELETE             http://sandboxapi.via.de/publicapi/v1/api.svc/Products(1L)

Tags:
Erstellt von Thomas Hoffmann am 2012/08/22 10:37

Copyright 2004-2023 XWiki