Code Block |
---|
language | php |
---|
title | Authentication Name (authmap) |
---|
collapse | true |
---|
|
$authmap = array(
'uid' => 1,
'authname' => 'ethosce_authname',
'module' => 'ethosce_ext_module',
); |
Code Block |
---|
language | php |
---|
title | Cart Item (uc_cart_item) |
---|
collapse | true |
---|
|
$uc_cart_item = array(
'cart_id' => 1, // The user's uid
'nid' => 10, // The product's nid
'qty' => 1,
); |
Code Block |
---|
language | php |
---|
title | Course (course) |
---|
collapse | true |
---|
|
$course = array(
'title' => 'My New Course',
'type' => 'course',
'field_course_summary' => array(
'value' => 'this is the summary<b>This is bold</b>', // Basic HTML structure is supported
'format' => 'full_html'
),
"field_course_date" => array(
"value" => 1471452801, // The course opening date. A Unix UTC Timestamp
"value2" => 1471452801, // The course expiration date. A Unix UTC Timestamp
),
'model' => 'SKU_1234',
'status' => 1,
); |
Code Block |
---|
language | php |
---|
title | Course Credit (course_credit) |
---|
collapse | true |
---|
|
$course_credit = array(
'nid' => 10,
'type' => 'webservice_credit',
'increments' => 1,
'min' => 1,
'max' => 10,
'active' => 1,
'enable_variable_credit' => 1,
); |
Code Block |
---|
language | php |
---|
title | Awarded Credit (course_credit_awarded) |
---|
collapse | true |
---|
|
$course_credit_awarded = array(
'nid' => 10,
'uid' => 1,
'type' => 'webservice_credit',
'credits' => 4,
); |
Code Block |
---|
language | php |
---|
title | Course Enrollment (course_enrollment) |
---|
collapse | true |
---|
|
$course_enrollment = array(
'nid' => 10,
'uid' => 1,
'enrollmenttype' => 'webservice_call',
'type' => 'webservice_call',
'status' => 1,
); |
Code Block |
---|
language | php |
---|
title | Course Object Fulfillment (course_object_fulfillment) |
---|
collapse | true |
---|
|
$course_object_fulfillment = array(
'coid' => 30, // The course object id. This is different from the course nid.
'uid' => 1,
'grade_result' => 100,
'date_started' => 1471452801, // Unix UTC Timestamp
'date_completed' => 1471452801, // Unix UTC Timestamp
'complete' => 1,
); |
Code Block |
---|
language | php |
---|
title | Course Report (course_report) |
---|
collapse | true |
---|
|
$course_report = array(
'nid' => 10,
'uid' => 1,
'grade_result' => 0,
'date_completed' => NULL,
'updated' => 1471452801, // Unix UTC Timestamp
'complete' => 0,
'section' => 'course_content', // The course object module type
'section_name' => 'Webservice Object',
'coid' => 30,
); |
Code Block |
---|
language | php |
---|
title | Imported Transcript Record (transcript_import) |
---|
collapse | true |
---|
|
$transcript_import = array(
'imported' => 0,
'nid' => 10,
'attended' => 0,
'complete' => 1,
'external_mail' => 'webservice_user@dlcdev.com',
'date_completed' => 1471452801, // Unix UTC Timestamp
'start' => 1471452801, // Unix UTC Timestamp
'credit_type' => 'webservice_credit',
'credits' => 10,
); |
Code Block |
---|
language | php |
---|
title | Node (node) |
---|
collapse | true |
---|
|
$node = array(
'title' => 'my new page',
'type' => 'page',
'body' => array(
'value' => 'this is the <b>body field</b>',
'format' => 'full_html' // Text format is required
),
'author' => 1,
'status' => 1, // Published
); |
Code Block |
---|
language | php |
---|
title | Order (uc_order) |
---|
collapse | true |
---|
|
$uc_order = array(
"uid" => 1,
"customer" => 1, // The user's uid
"delivery_address" => array(
"first_name" => "WS First",
"last_name" => "WS Last",
"company" => "DLC",
"street1" => "1520 Locust",
"street2" => "Suite 1000",
"city" => "Philadelphia",
"zone" => "51", // Needed? Auto assigned via postal code? See uc_zones table
"postal_code" => "19102",
"country" => "840", // Needed? See uc_countries table. Also: https://en.wikipedia.org/wiki/ISO_3166-1_numeric
"phone" => "215-321-1234",
"email" => "webservice_user@dlcdev.com"
),
"billing_address" => array(
"first_name" => "WS First",
"last_name" => "WS Last",
"company" => "DLC",
"street1" => "1520 Locust",
"street2" => "Suite 1000",
"city" => "Philadelphia",
"zone" => "51", // Needed? Auto assigned via postal code? See uc_zones table
"postal_code" => "19102",
"country" => "840", // Needed? See uc_countries table. Also: https://en.wikipedia.org/wiki/ISO_3166-1_numeric
"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" => 1471452801, // Unix UTC Timestamp
"modified" => 1471452801, // Unix UTC Timestamp
"host" => "127.0.0.1",
); |
Code Block |
---|
language | php |
---|
title | Order (uc_order_product) |
---|
collapse | true |
---|
|
$uc_order_product = array(
'order_id' => 60, // Order id from uc_orders table
'nid' => 10,
'title' => 'my new course',
'model' => 'course_10',
'qty' => 1,
'cost' => 1,
'price' => 1,
); |
Code Block |
---|
language | php |
---|
title | Profile (profile2) |
---|
collapse | true |
---|
|
$profile2 = array(
'user' => 1,
'label' => 'Profile',
'type' => 'profile',
'field_first_name' => 'John',
'field_middle_name' => 'Middle',
'field_last_name' => 'Smith',
'field_profile_location' => array(
'street' => '1520 Locust Street',
'additional' => 'Suite 1000',
'city' => 'Phila',
'province' => 'PA',
'postal_code' => '19102',
'country' => 'us',
),
// 'field_learner_type' => 'Student',
// 'field_boolean' => 1,
// 'field_date' => (1471452801 - 86400),
// 'field_checkbox' => array(
// 'und' => array(
// 'option_two',
// 'option_four',
// ),
// ),
); |
Code Block |
---|
language | php |
---|
title | Quiz Result (quiz_result) |
---|
collapse | true |
---|
|
$quiz_result = array(
); |
Code Block |
---|
language | php |
---|
title | Quiz Result Answer (quiz_result_answer) |
---|
collapse | true |
---|
|
$quiz_result_answer = array(
); |
...
language | php |
---|
title | User (user) |
---|
collapse | true |
---|
...
The following data examples are in JSON format.
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:sZ). Additionally, both date formats must be converted to UTC before being sent, to ensure data integrity between systems.
Info |
---|
Entered local time: December 31, 2014, 12:00PM EST Converted to UTC/GMT: December 31, 2014, 5:00PM UTC ISO 8601 format: 2014-12-31T17:00:00Z Epoch format: 1420045200 |
Supported Data Structures
Child pages (Children Display) |
---|
|