Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

The following data examples are in PHP format. They may be converted to JSON or XML as a guide to structuring correctly formatted web service calls.

Authentication Name (authmap)
$authmap = {
 'uid' : 1,
 'authname' : 'ethosce_authname',
 'module' : 'ethosce_ext_module',
 };
Cart Item (uc_cart_item)
$uc_cart_item = {
      'cart_id' : 1, // The user's uid
      'nid' : 10, // The product's nid
      'qty' : 1,
 };
Course (course)
$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" : 1471452801, // The course opening date. A Unix UTC Timestamp
        "value2" : 1471452801, // The course expiration date. A Unix UTC Timestamp
      },
      'model' : 'SKU_1234',
      'status' : 1,
 };
Course Credit (course_credit)
$course_credit = {
      'nid' : 10,
      'type' : 'webservice_credit',
      'increments' : 1,
      'min' : 1,
      'max' : 10,
      'active' : 1,
      'enable_variable_credit' : 1,
 };
Awarded Credit (course_credit_awarded)
$course_credit_awarded = {
      'nid' : 10,
      'uid' : 1,
      'type' : 'webservice_credit',
      'credits' : 4,
 };
Course Enrollment (course_enrollment)
$course_enrollment = {
      'nid' : 10,
      'uid' : 1,
      'enrollmenttype' : 'webservice_call',
      'type' : 'webservice_call',
      'status' : 1,
 };
Course Object Fulfillment (course_object_fulfillment)
$course_object_fulfillment = {
      '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,
 };
Course Report (course_report)
$course_report = {
      '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,
    };
Imported Transcript Record (transcript_import)
$transcript_import = {
      '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,
    };
Node (node)
$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
    };
Order (uc_order)
$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" : 1471452801, // Unix UTC Timestamp
      "modified" : 1471452801, // Unix UTC Timestamp
      "host" : "127.0.0.1",
    };
Order (uc_order_product)
$uc_order_product = {
      'order_id' : 60,
      'nid' : 10,
      'title' : 'my new course',
      'model' : 'course_10',
      'qty' : 1,
      'cost' : 1,
      'price' : 1,
    };
Profile (profile2)
$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',
    //    },
    //  },
    };
User (user)
$user = {
      'name' : 'webservice_username', // Username
      'mail' : 'webservice@dlcdev.com',
      'status' : 1,
    };
  • No labels