CourseSales.com Web Services - REST

Monday, Sep 23, 2013

Authentication

Before you can consume REST services you must create a user:

  1. Log into CourseSales.com

  2. Select Setup on the top row of the Ribbon

  3. Select the large Logins icon

  4. A user with the username SoapSoap is usually created when a CourseSales.com account is first set up - see if you can find this user, and click the Edit icon. If there is no SoapSoap user then click New on the Ribbon to create a new user. (Note, if you end up with two soap users you may have problems later - you can use the advanced filter to see how many soap users you have, filter without a status).

  5. Make sure the user has a valid username, that a password has been set (you will need this password later), and that the user has Status of Active. Also make sure the CourseSales.com Internal Type is Soap.

  6. Save the record.

Service Call

The location / URI is:

https://[yoursubdomain].coursesales.com/rest/index

The URI accepts a JSON encoded array as its only parameter, and the function returns a JSON encoded array.

You must specify login details in the request, by adding them to the lowest level of the array:

eg in PHP this would be:

$parameters = array(); $parameters[‘LoginUsername’] = ‘yourSoapUsername’; $parameters[‘LoginPassword’] = ‘yourSoapPassword’;

Worked example for PHP

$parameters = array();

$parameters[‘LoginUsername’] = ‘yourSoapUsername’; $parameters[‘LoginPassword’] = ‘yourSoapPassword’;

return ‘https://[yoursubdomain].coursesales.com/rest/index?’. json_encode( $parameters );