API Addon für Artikelkonfigurator für Sets

In den nächsten Tagen wird ein Addon für den Artikelkonfigurator für Sets veröffentlicht, das die API von Shopware erweitert.
Daten für den Konfigurator können dann per API importiert, exportiert sowie aktualisiert werden können. die genaue Funktionen werden demnächst veröffentlicht.

DOKUMENTATION

Konfigurator

The resource gets called by our controller. Every controller action relies on one method of our resource.


indexAction -> getList() -> returns a list of Configurators
getAction -> getOne() -> returns one Configurator identified by its id
putAction -> update() -> updates one Configurator identified by its id
postAction -> create() -> creates a new Configurator
deleteAction -> delete() -> deletes a Configurator
| Action name  | Request type   | parameter   |
|--------------|----------------|-------------|
| indexAction  | get request    | no          |
| getAction    | get request    | id          |
| putAction    | put request    | id          |
| postAction   | post request   | data fields |
| deleteAction | delete request | id          |

Data:


{
"success":true,
"data":{
"id":1,
"title":"PC Konfigurator",
"csku":"0000-00-00",
"added":"-0001-11-30T00:00:00+0100",
"changed":"-0001-11-30T00:00:00+0100",
"active":true,
"isstepper":false,
"description":"Konfigurieren Sie ihren eigenen PC.W\u00e4hlen Sie Ihre gew\u00fcnschten Komponenten aus.<\/p>",
"media":[
{
"id":72,
"confiId":1,
"mediaId":3,
"preview":true,
"media":{
"id":3,
"albumId":-1,
"name":"artikelkonfiguratorfuersets",
"description":"",
"path":"media\/image\/artikelkonfiguratorfuersets.jpg",
"type":"IMAGE",
"extension":"jpg",
"userId":50,
"created":"2017-08-11T00:00:00+0200",
"fileSize":34820,
"width":600,
"height":600
}
}
]
}
}

Liste aller Konfiguratoren

  • Ressource: indexAction

  • Url : /api/configurator

  • Rest Api Url : /confiapi/confiexport?user=xxx&password=xxx

  • Filter:

    By ID:
    /api/configurator/?filter[0][property]=confi.id&filter[0][value]=2
    

Einen Konfigurator laden

  • Ressource: getAction
  • ID: required
  • Url : /api/configurator/1
  • Rest Api Url : /confiapi/confiexport?id=1&user=xxx&password=xxx

Einen Konfigurator updaten

  • Ressource: putAction

  • Rest Api Url: /confiapi/confiUpdate?id=1&user=xxx&password=xxx

  • ID: required

  • POST Data:

    "title":"PC Konfigurator",
    "csku":"0000-00-00",
    "added":"-0001-11-30T00:00:00+0100",
    "changed":"-0001-11-30T00:00:00+0100",
    "active":true,
    "isstepper":false,
    "description":"Konfigurieren Sie ihren eigenen PC. Wählen Sie Ihre gewünschten Komponenten aus.<\/p>",
    
  • Rückgabe:

                       {
    "success":true,
    "data":{
    "id":1,
    "location":"http://**/api/Configurator/1"
    }
    }	

Einen Konfigurator hinzufügen

  • Ressource: postAction

  • Rest Api Url: /confiapi/confiInsert?&user=xxx&password=xxx

  • ID: not required

  • POST Data:

    "title":"PC Konfigurator",
    "csku":"0000-00-00",
    "added":"-0001-11-30T00:00:00+0100",
    "changed":"-0001-11-30T00:00:00+0100",
    "active":true,
    "isstepper":false,
    "description":"Konfigurieren Sie ihren eigenen PC. Wählen Sie Ihre gewünschten Komponenten aus.<\/p>",
    
  • Rückgabe:

                       {
    "success":true,
    "data":{
    "id":1,
    "location":"http://**/api/Configurator/1"
    }
    }	

Gruppen

The resource gets called by our controller. Every controller action relies on one method of our resource.


indexAction -> getList() -> returns a list of groups
getAction -> getOne() -> returns one group identified by its id
putAction -> update() -> updates one group identified by its id
postAction -> create() -> creates a new group
deleteAction -> delete() -> deletes a group
| Action name  | Request type   | parameter   |
|--------------|----------------|-------------|
| indexAction  | get request    | no          |
| getAction    | get request    | id          |
| putAction    | put request    | id          |
| postAction   | post request   | data fields |
| deleteAction | delete request | id          |

Data:


{
"success":true,
"data":{
"id":4,
"confiId":1,
"title":"Mainboard (Imageradio)",
"esku":"mainboard-336182195",
"confititle":"PC Konfigurator",
"template":"imageradio.tpl",
"owntemplate":"",
"component":"imageradio",
"description":"Konfigurieren Sie ihren eigenen PC.W\u00e4hlen Sie Ihre gew\u00fcnschten Komponenten aus.<\/p>",
"position":5,
"active":true,
"slider":true,
"cssstyle":null
}
}

Liste aller Gruppen

  • Ressource: indexAction

  • Url : /api/elements

  • Rest Api Url : /confiapi/elementsexport?user=xxx&password=xxx

  • Filter:

    By ID
    /api/elements/?filter[0][property]=celements.id&filter[0][value]=2
    by Configurator ID
    /api/elements/?filter[0][property]=celements.confiId&filter[0][value]=1
    

Einen Gruppe laden

  • Ressource: getAction
  • ID: required
  • Url : /api/elements/1
  • Rest Api Url : /confiapi/elementsexport?id=1&user=xxx&password=xxx

Eine Gruppe updaten

  • Ressource: putAction

  • Rest Api Url: /confiapi/elementsUpdate?id=1&user=xxx&password=xxx

  • ID: required

  • POST Data:

        "confiId":1,
    "title":"Mainboard (Imageradio)",
    "esku":"mainboard-336182195",
    "confititle":"PC Konfigurator",
    "template":"imageradio.tpl",
    "owntemplate":"",
    "component":"imageradio",
    "description":"Konfigurieren Sie ihren eigenen PC.W\u00e4hlen Sie Ihre gew\u00fcnschten Komponenten aus.<\/p>",
    "position":5,
    "active":true,
    "slider":true,
    "cssstyle":null
    
  • Rückgabe:

                       {
    "success":true,
    "data":{
    "id":1,
    "location":"http://**/api/Elements/1"
    }
    }	

Eine Gruppe hinzufügen

  • Ressource: postAction

  • Rest Api Url: /confiapi/elementsInsert?&user=xxx&password=xxx

  • ID: not required

  • POST Data:

        "confiId":1,
    "title":"Mainboard (Imageradio)",
    "esku":"mainboard-336182195",
    "confititle":"PC Konfigurator",
    "template":"imageradio.tpl",
    "owntemplate":"",
    "component":"imageradio",
    "description":"Konfigurieren Sie ihren eigenen PC.W\u00e4hlen Sie Ihre gew\u00fcnschten Komponenten aus.<\/p>",
    "position":5,
    "active":true,
    "slider":true,
    "cssstyle":null
    
  • Rückgabe:

                       {
    "success":true,
    "data":{
    "id":1,
    "location":"http://**/api/Elements/1"
    }
    }	

Komponenten

The resource gets called by our controller. Every controller action relies on one method of our resource.


indexAction -> getList() -> returns a list of components
getAction -> getOne() -> returns one component identified by its id
putAction -> update() -> updates one component identified by its id
postAction -> create() -> creates a new component
deleteAction -> delete() -> deletes a component
| Action name  | Request type   | parameter   |
|--------------|----------------|-------------|
| indexAction  | get request    | no          |
| getAction    | get request    | id          |
| putAction    | put request    | id          |
| postAction   | post request   | data fields |
| deleteAction | delete request | id          |

Data:


{
"success":true,
"data":{
"id":4,
"elementsId":3,
"articleId":0,
"isarticle":true,
"isvalidate":false,
"isnumeric":false,
"allowblockprices":true,
"title":"Arbeitsspeicher",
"vsku":"SW10013",
"description":"Wählen Sie Ihre gewünschten Komponenten aus.<\/p>",
"elementstitle":"Arbeitsspeicher (Checkbox)",
"inumber":"SW10013",
"price":0,
"position":0,
"prefix":"+",
"minValue":0,
"maxValue":0,
"minwidth":0,
"maxwidth":0,
"active":true,
"preselect":true,
"addqty":false,
"pricechange":true
}
}

Liste aller Komponenten

  • Ressource: indexAction

  • Url : /api/komponenten

  • Rest Api Url : /confiapi/compoexport?user=xxx&password=xxx

  • Filter:

    By ID
    /api/elements/?filter[0][property]=cvalues.id&filter[0][value]=2
    by Group ID
    /api/elements/?filter[0][property]=cvalues.elementsId&filter[0][value]=1
    

Eine Komponente laden

  • Ressource: getAction
  • ID: required
  • Url : /api/elements/1
  • Rest Api Url : /confiapi/compoexport?id=1&user=xxx&password=xxx

Eine Komponente updaten

  • Ressource: putAction

  • Rest Api Url: /confiapi/compoUpdate?id=1&user=xxx&password=xxx

  • ID: required

  • POST Data:

      "elementsId":3,
    "articleId":0,
    "isarticle":true,
    "isvalidate":false,
    "isnumeric":false,
    "allowblockprices":true,
    "title":"Arbeitsspeicher",
    "vsku":"SW10013",
    "description":"Wählen Sie Ihre gewünschten Komponenten aus.<\/p>",
    "elementstitle":"Arbeitsspeicher (Checkbox)",
    "inumber":"SW10013",
    "price":0,
    "position":0,
    "prefix":"+",
    "minValue":0,
    "maxValue":0,
    "minwidth":0,
    "maxwidth":0,
    "active":true,
    "preselect":true,
    "addqty":false,
    "pricechange":true
    
  • Rückgabe:

                       {
    "success":true,
    "data":{
    "id":1,
    "location":"http://**/api/Komponenten/1"
    }
    }	

Eine Komponente hinzufügen

  • Ressource: postAction

  • Rest Api Url: /confiapi/compoInsert?&user=xxx&password=xxx

  • ID: not required

  • POST Data:

      "elementsId":3,
    "articleId":0,
    "isarticle":true,
    "isvalidate":false,
    "isnumeric":false,
    "allowblockprices":true,
    "title":"Arbeitsspeicher",
    "vsku":"SW10013",
    "description":"Wählen Sie Ihre gewünschten Komponenten aus.<\/p>",
    "elementstitle":"Arbeitsspeicher (Checkbox)",
    "inumber":"SW10013",
    "price":0,
    "position":0,
    "prefix":"+",
    "minValue":0,
    "maxValue":0,
    "minwidth":0,
    "maxwidth":0,
    "active":true,
    "preselect":true,
    "addqty":false,
    "pricechange":true
    
  • Rückgabe:

                       {
    "success":true,
    "data":{
    "id":1,
    "location":"http://**/api/Komponenten/1"
    }
    }	

Pixeleyes GmbH

Sie werden Augen machen!