Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The following data examples are in JSON format.All dates must be in ISO

Date Formatting

There are 2 date formats used when interacting with the web service, epoch and ISO 8601. The call being made informs which format to use. All GET calls, to pull information from EthosCE, require the URL friendly epoch time. A call for creation or update must use the database compatible ISO 8601 format (Y-m-d\TH:i:ssZ), and . Additionally, both date formats must be converted to UTC .In example,
Entered before being sent, to ensure data integrity between systems.

Info
iconfalse
Entered local time: December 31, 2014, 12:00PM EST
Converted to UTC/GMT: December 31, 2014, 5:00PM UTC

...

ISO 8601 format:  
Code Block
languagejs
titleUser (user)
collapsetrue
var user = { "name" : "webservice_username", // Username "mail" : "webservice@dlcdev.com", "status" : 1, };2014-12-31T17:00:00Z

...

Code Block
languagejs
titleAuthentication Name (authmap)
collapsetrue
var authmap = {
  "uid" : 1,
  "authname" : "ethosce_authname",
  "module" : "ethosce_ext_module",
};
Code Block
languagejs
titleCart Item (uc_cart_item)
collapsetrue
var uc_cart_item = {
  "cart_id" : 1, // The user"s uid
  "nid" : 10, // The product"s nid
  "qty" : 1,
};
Code Block
languagejs
titleCourse (course)
collapsetrue
var course = {
  "title" : "My New Course",
  "type" : "course",
  "field_course_summary" : {
    "value" : "this is the summary<b>This is bold</b>", // Basic HTML structure is supported
    "format" : "filtered_html"
  },
  "field_course_date" : {
    "value" : date('Y-m-d\TH:i:s', 1471452801), // The course opening date. In ISO format
    "value2" : date('Y-m-d\TH:i:s', 1471452801), // The course expiration date In ISO format
  },
  "model" : "SKU_1234",
  "status" : 1,
};
Code Block
languagejs
titleCourse Credit (course_credit)
collapsetrue
var course_credit = {
  "nid" : 10,
  "type" : "webservice_credit",
  "increments" : 1,
  "min" : 1,
  "max" : 10,
  "active" : 1,
  "enable_variable_credit" : 1,
};
Code Block
languagejs
titleAwarded Credit (course_credit_awarded)
collapsetrue
var course_credit_awarded = {
  "nid" : 10,
  "uid" : 1,
  "type" : "webservice_credit",
  "credits" : 4,
};
Code Block
languagejs
titleCourse Enrollment (course_enrollment)
collapsetrue
var course_enrollment = {
  "nid" : 10,
  "uid" : 1,
  "enrollmenttype" : "webservice_call", // Can be any value. Used to flag where an enrollment came from.
  "type" : "course_enrollment", // The field bundle to use. Can be omitted.
  "status" : 1,
};
Code Block
languagejs
titleCourse Object Fulfillment (course_object_fulfillment)
collapsetrue
var course_object_fulfillment = {
  "coid" : 30, // The course object id. This is different from the course nid.
  "uid" : 1,
  "grade_result" : 100,
  "date_started" : date('Y-m-d\TH:i:s', 1471452801), // In ISO format
  "date_completed" : date('Y-m-d\TH:i:s', 1471452801), // In ISO format
  "complete" : 1,
};
Code Block
languagejs
titleCourse Report (course_report)
collapsetrue
var course_report = {
  "nid" : 10,
  "uid" : 1,
  "grade_result" : 0,
  "date_completed" : NULL,
  "updated" : date('Y-m-d\TH:i:s', 1471452801), // In ISO format
  "complete" : 0,
  "section" : "course_content", // The course object module type
  "section_name" : "Webservice Object",
  "coid" : 30,
};
Code Block
languagejs
titleImported Transcript Record (transcript_import)
collapsetrue
var transcript_import = {
  "imported" : 0,
  "nid" : 10,
  "attended" : 0,
  "complete" : 1,
  "external_mail" : "webservice_user@dlcdev.com",
  "date_completed" : date('Y-m-d\TH:i:s', 1471452801), // In ISO format
  "start" : date('Y-m-d\TH:i:s', 1471452801), // In ISO format
  "credit_type" : "webservice_credit",
  "credits" : 10,
};
Code Block
languagejs
titleNode (node)
collapsetrue
var node = {
  "title" : "my new page",
  "type" : "page",
  "body" : {
    "value" : "this is the <b>body field</b>",
    "format" : "filtered_html" // Text format is required
  },
  "author" : 1,
  "status" : 1, // Published
};
Code Block
languagejs
titleOrder (uc_order)
collapsetrue
var uc_order = {
  "uid" : 1,
  "customer" : 1, // The user"s uid
  "delivery_address" : {
    "first_name" : "Tom",
    "last_name" : "Baker",
    "company" : "DLC",
    "street1" : "1520 Locust",
    "street2" : "Suite 1000",
    "city" : "Philadelphia",
    "postal_code" : "19102",
    "phone" : "215-321-1234",
    "email" : "webservice_user@dlcdev.com"
  },
  "billing_address" : {
    "first_name" : "WS First",
    "last_name" : "WS Last",
    "company" : "DLC",
    "street1" : "1520 Locust",
    "street2" : "Suite 1000",
    "city" : "Philadelphia",
    "postal_code" : "19102",
    "phone" : "215-321-1234",
    "email" : "webservice_user@dlcdev.com"
  },
  "order_status" : "completed",
  "order_total" : 250.00,
  "primary_email" : "webservice_user@dlcdev.com",
  "payment_method" : "",
  "created" : date('Y-m-d\TH:i:s', 1471452801), // In ISO format
  "modified" : date('Y-m-d\TH:i:s',1471452801), // In ISO format
  "host" : "127.0.0.1",
};
Code Block
languagejs
titleOrder (uc_order_product)
collapsetrue
var uc_order_product = {
  "order_id" : 60,
  "nid" : 10,
  "title" : "my new course",
  "model" : "course_10",
  "qty" : 1,
  "cost" : 1,
  "price" : 1,
};
Code Block
languagejs
titleProfile (profile2)
collapsetrue
var profile2 = {
  "user" : 1,
  "label" : "Profile",
  "type" : "profile",
  "field_first_name" : "Tom",
  "field_middle_name" : "Stewart",
  "field_last_name" : "Baker",
  "field_profile_location" : {
    "street" : "1520 Locust Street",
    "additional" : "Suite 1000",
    "city" : "Phila",
    "province" : "PA",
    "postal_code" : "19102",
    "country" : "us",
  },
// "field_boolean" : 1,
// "field_checkbox" : {
//   "und" : {
//     "option_one",
//     "option_two",
//    },
//  },
};

Epoch format: 1420045200

Supported Data Structures

Child pages (Children Display)
alltrue