Skip to content

Basic import request

James Williamson edited this page Jul 13, 2018 · 10 revisions

It is best to start with a basic payload

Properties

  • meta: Contains information to be logged when the import has started.
  • settings: Used to control behaviour during Import.
  • data: Payload such as Companies, People, Users etc are placed in here.
{
  "meta": {
    "created_at": "2018-02-15T17:33:56+0000",
    "feed_name": "The corporation"
  },
  "settings": {
    "version": "0.0.1"
  },
  "data": {
    "people": [],
    "companies": [],
    "users": []
    }
  }
}

People, Companies and Users can contain objects that are imported. You can read more about this here

The Curl request for the API looks like this:

curl -X POST \
  https://bedbathstore.bookingbug.com/api/v1/admin/37000/imports \
  -H 'App-Id: f7caacd6' \
  -H 'App-key: 37a832ad5d61b7575c2890540c55562b' \
  -H 'Auth-Token: KzEWHYq1tgOtcFCU0Y8uvw' \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json' \
  -H 'Postman-Token: 99b50893-b1a1-4854-8601-681fb8d97e43' \
  -d '{
  "meta": {
    "created_at": "2018-06-27T09:40:15+01:00",
    "feed_name": "asushnet"
  },
  "settings": {
    "version": "0.0.1"
  },
  "data": {
    "companies": [
      {
        "name": "West Lake Country Club",
        "external_id": "34335",
        "object_type": "company",
        "last_modified": "2018-06-24T22:22:28+01:00",
        "status": "live"
      }
    ]
  }
}'

Clone this wiki locally