Back to top

Dsync Connector (Destination)

Incoming requests to the system connector.

Resource Group

Data Layout

Get data layout
GET/datalayout

Get all data layouts (schemas) from the connector

Example URI

GET http://dsync.connector.example//datalayout
Request
HideShow
Headers
Content-Type: application/json
Auth-Token: 080ab6bd49b138594ac9647dc929122adfb983c8
Response  200
HideShow

The data layout is returned without any issues.

Headers
Content-Type: application/json
Body
{
  "status": 200,
  "message": "OK",
  "detail": {},
  "data": {
    "data_layout": [
      {
        "entity_name": "product",
        "treekey": "product",
        "endpoint_url": "/entity/product",
        "entity_token": "source-1-product-462705796aa4d94d3a35d7254637a943",
        "fields": [
          {
            "treekey": "product.sku",
            "name": "sku",
            "description": "The product sku",
            "required": true,
            "multiple": false,
            "type": "text",
            "primary_key": true
          },
          {
            "name": "inventory",
            "treekey": "product.inventory",
            "type": "object",
            "multiple": false,
            "fields": [
              {
                "treekey": "product.inventory.qty",
                "name": "qty",
                "description": "The product inventory quantity",
                "required": false,
                "multiple": false,
                "type": "number"
              },
              {
                "treekey": "product.inventory.min_qty",
                "name": "min_qty",
                "description": "The product inventory minimum quantity",
                "required": false,
                "multiple": false,
                "type": "number"
              }
            ]
          }
        ]
      },
      {
        "entity_name": "order",
        "treekey": "order",
        "endpoint_url": "http://dsync.connector.example/entity/order",
        "entity_token": "source-1-order-b5503a0ae5f3bc01b6a2da68afd33305",
        "fields": [
          {
            "treekey": "order.order_id",
            "name": "order_id",
            "description": "The order id",
            "required": true,
            "multiple": false,
            "type": "text"
          },
          {
            "treekey": "order.customer_name",
            "name": "customer_name",
            "description": "The customer name for this order",
            "required": false,
            "multiple": false,
            "type": "text"
          },
          {
            "treekey": "order.product_id",
            "name": "Product id",
            "description": "The id of product",
            "required": false,
            "multiple": false,
            "type": "text",
            "foreign_key": "product"
          }
        ]
      },
      {
        "treekey": "order.gift_message",
        "name": "gift_message",
        "multiple": false,
        "type": "object",
        "fields": [
          {
            "treekey": "order.gift_message.gift_message_from",
            "name": "gift_message_from",
            "description": "The sender of the gift message",
            "required": false,
            "multiple": false,
            "type": "text"
          },
          {
            "treekey": "order.gift_message.gift_message_to",
            "name": "gift_message_to",
            "description": "The receiver of the gift message",
            "required": false,
            "multiple": false,
            "type": "text"
          },
          {
            "treekey": "order.gift_message.gift_message_body",
            "name": "gift_message_body",
            "description": "The body of the gift message",
            "required": false,
            "multiple": false,
            "type": "text"
          }
        ]
      }
    ]
  }
}
Response  401
HideShow

The data layout will not be returned because authentication is required and has failed or has not been provided.

Headers
Content-Type: application/json
Body
{
  "status": 401,
  "message": "Unauthorized",
  "detail": {},
  "data": {}
}
Response  500
HideShow

The data layout cannot be returned because an unexpected condition was encountered by the server.

Headers
Content-Type: application/json
Body
{
  "status": 500,
  "message": "Internal Server Error",
  "detail": {},
  "data": {}
}

Entities

Create an entity
POST/entity/{entity_name}

Create an entity in the connector

Example URI

POST http://dsync.connector.example//entity/entity_name
URI Parameters
HideShow
entity_name
string (required) 

String name of the entity type

Request
HideShow
Headers
Content-Type: application/json
Auth-Token: 080ab6bd49b138594ac9647dc929122adfb983c8
Entity-Token: source-1-product-462705796aa4d94d3a35d7254637a943
Process-Id: 123456
Body
{
  "type_id": "simple",
  "sku": "hde012",
  "name": "Madison 8GB Digital Media Player",
  "meta_title": null,
  "meta_description": null,
  "url_key": "madison-8gb-digital-media-player",
  "url_path": "madison-8gb-digital-media-player.html",
  "custom_design": null,
  "page_layout": "1 column",
  "options_container": "Product Info Column",
  "image_label": null,
  "small_image_label": null,
  "thumbnail_label": null,
  "country_of_manufacture": "AU",
  "msrp_enabled": "Use config",
  "msrp_display_actual_price_type": "Use config",
  "gift_message_available": "No",
  "gift_wrapping_available": "No",
  "color": "Black",
  "status": "Enabled",
  "visibility": "Catalog, Search"
}
Response  201
HideShow

The entity has been created and didn’t encounter any issues.

Headers
Content-Type: application/json
Body
{
  "status": 201,
  "message": "Created",
  "detail": {},
  "data": {
    "sku": "hde012"
  }
}
Response  202
HideShow

The entity has been accepted for processing, but the processing has not been completed.

Headers
Content-Type: application/json
Body
{
  "status": 202,
  "message": "Accepted",
  "detail": {},
  "data": {}
}
Response  400
HideShow

The entity cannot or will not be processed due to something that is missing/invalid in the request.

Headers
Content-Type: application/json
Body
{
  "status": 400,
  "message": "Bad Request",
  "detail": {},
  "data": {}
}
Response  401
HideShow

The entity will not be processed because authentication is required and has failed or has not been provided.

Headers
Content-Type: application/json
Body
{
  "status": 401,
  "message": "Unauthorized",
  "detail": {},
  "data": {}
}
Response  409
HideShow

The entity will not be processed because of conflict in the request, such as an entity that already exists.

Headers
Content-Type: application/json
Body
{
  "status": 409,
  "message": "Conflict",
  "detail": {},
  "data": {}
}
Response  500
HideShow

The entity cannot be processed because an unexpected condition was encountered by the server.

Headers
Content-Type: application/json
Body
{
  "status": 500,
  "message": "Internal Server Error",
  "detail": {},
  "data": {}
}

Update an entity
PUT/entity/{entity_name}

Update an entity in the connector

Example URI

PUT http://dsync.connector.example//entity/entity_name
URI Parameters
HideShow
entity_name
string (required) 

String name of the entity type

Request
HideShow
Headers
Content-Type: application/json
Auth-Token: 080ab6bd49b138594ac9647dc929122adfb983c8
Entity-Token: source-1-product-462705796aa4d94d3a35d7254637a943
Process-Id: 123456
Entity-Id: hde012
Body
{
  "sku": "hde012",
  "color": "White",
  "status": "Disabled"
}
Response  200
HideShow

The entity has been updated and didn’t encounter any issues.

Headers
Content-Type: application/json
Body
{
  "status": 200,
  "message": "Created",
  "detail": {},
  "data": {}
}
Response  202
HideShow

The entity has been accepted for processing, but the processing has not been completed.

Headers
Content-Type: application/json
Body
{
  "status": 202,
  "message": "Accepted",
  "detail": {},
  "data": {}
}
Response  400
HideShow

The entity cannot or will not be processed due to something that is missing/invalid in the request.

Headers
Content-Type: application/json
Body
{
  "status": 400,
  "message": "Bad Request",
  "detail": {},
  "data": {}
}
Response  401
HideShow

The entity will not be processed because authentication is required and has failed or has not been provided.

Headers
Content-Type: application/json
Body
{
  "status": 401,
  "message": "Unauthorized",
  "detail": {},
  "data": {}
}
Response  500
HideShow

The entity cannot be processed because an unexpected condition was encountered by the server.

Headers
Content-Type: application/json
Body
{
  "status": 500,
  "message": "Internal Server Error",
  "detail": {},
  "data": {}
}

Delete an entity
DELETE/entity/{entity_name}

Delete an entity in the connector

Example URI

DELETE http://dsync.connector.example//entity/entity_name
URI Parameters
HideShow
entity_name
string (required) 

String name of the entity type

Request
HideShow
Headers
Content-Type: application/json
Auth-Token: 080ab6bd49b138594ac9647dc929122adfb983c8
Entity-Token: source-1-product-462705796aa4d94d3a35d7254637a943
Process-Id: 123456
Entity-Id: hde012
Body
{}
Response  200
HideShow

The entity has been deleted and didn’t encounter any issues.

Headers
Content-Type: application/json
Body
{
  "status": 200,
  "message": "OK",
  "detail": {},
  "data": {}
}
Response  202
HideShow

The entity has been accepted for processing, but the processing has not been completed.

Headers
Content-Type: application/json
Body
{
  "status": 202,
  "message": "Accepted",
  "detail": {},
  "data": {}
}
Response  400
HideShow

The entity cannot or will not be processed due to something that is missing/invalid in the request.

Headers
Content-Type: application/json
Body
{
  "status": 400,
  "message": "Bad Request",
  "detail": {},
  "data": {}
}
Response  401
HideShow

The entity will not be processed because authentication is required and has failed or has not been provided.

Headers
Content-Type: application/json
Body
{
  "status": 401,
  "message": "Unauthorized",
  "detail": {},
  "data": {}
}
Response  500
HideShow

The entity cannot be processed because an unexpected condition was encountered by the server.

Headers
Content-Type: application/json
Body
{
  "status": 500,
  "message": "Internal Server Error",
  "detail": {},
  "data": {}
}

Process Notifications

Add a process notification
POST/notification

Add a process notification (or multiple notifications) in the connector from Dsync

Example URI

POST http://dsync.connector.example//notification
Request
HideShow
Headers
Content-Type: application/json
Auth-Token: 080ab6bd49b138594ac9647dc929122adfb983c8
Process-Id: 123456
Body
{
  "process_id": "123456",
  "status": "500",
  "message": "Server error updating entity",
  "data": {
    "notifications": [
      {
        "node_id": "45",
        "status": "200",
        "message": "Entity updated"
      },
      {
        "node_id": "46",
        "status": "500",
        "message": "Server error updating entity"
      }
    ]
  }
}
Response  200
HideShow

The notification(s) has been added and didn’t encounter any issues.

Headers
Content-Type: application/json
Body
{
  "status": 200,
  "message": "OK",
  "detail": {},
  "data": {}
}
Response  400
HideShow

The notification(s) cannot or will not be processed due to something that is missing/invalid in the request.

Headers
Content-Type: application/json
Body
{
  "status": 400,
  "message": "Bad Request",
  "detail": {},
  "data": {}
}
Response  401
HideShow

The notification(s) will not be processed because authentication is required and has failed or has not been provided.

Headers
Content-Type: application/json
Body
{
  "status": 401,
  "message": "Unauthorized",
  "detail": {},
  "data": {}
}
Response  500
HideShow

The notification(s) cannot be processed because an unexpected condition was encountered by the server.

Headers
Content-Type: application/json
Body
{
  "status": 500,
  "message": "Internal Server Error",
  "detail": {},
  "data": {}
}

Job notification

Add job for entity
POST/entity/{entity_name}/set_job

Create new relation with entity

Example URI

POST http://dsync.connector.example//entity/entity_name/set_job
URI Parameters
HideShow
entity_name
string (required) 

String name of the entity type

Request
HideShow
Headers
Content-Type: application/json
Auth-Token: 080ab6bd49b138594ac9647dc929122adfb983c8
Body
{
    "job_id" : "a123456",
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": 200,
  "message": "OK",
  "detail": {},
  "data": {}
}

Mass synchronization

Get total

Get pagination
GET/api/sync/total

Example URI

GET http://dsync.connector.example//api/sync/total
Request
HideShow
Headers
Content-Type: application/json
Auth-Token: 080ab6bd49b138594ac9647dc929122adfb983c8
Entity-Token: source-1-product-462705796aa4d94d3a35d7254637a943
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": 200,
  "message": "OK",
  "detail": {},
  "data": {
    "total": 5545,
    "per_page": 100
  }
}

Get items

Get pagination
GET/api/sync/items/

Example URI

GET http://dsync.connector.example//api/sync/items/
Request
HideShow
Headers
Content-Type: application/json
Auth-Token: 080ab6bd49b138594ac9647dc929122adfb983c8
Entity-Token: source-1-product-462705796aa4d94d3a35d7254637a943
Response  200
HideShow
Headers
Content-Type: application/json
Total: 5545
Per-Page: 100
Body
{
  "status": 200,
  "message": "OK",
  "detail": {},
  "data": {
    "items": []
  }
}

Generated by aglio on 19 Oct 2016