Webservice API Hash/Auth Signature Details
Had quite a time figuring out the hash signature part of the API. Important detail: you must Base64 encode the result of the HMACSHA1 hashing of your signature string. That base64 string is what you send on the auth packet that goes to the webservice. Also, your private key that you use for the HMAC hash is NOT in hex - you simply get the text encoding bytes from the string and send it straight to the HMAC method.
Code Example in C#:
// ex: 2008-09-26T14:52:02Z
DateTime now = DateTime.Now;
string timeStamp = now.ToUniversalTime().ToString("yyyy-MM-dd") + "T" + now.ToUniversalTime().ToString("HH:mm:ss") + "Z";
// serviceName + operationName + timestamp
// ex: 2009-04-01/CustomerAPIServicedoesUserExist2008-09-26T14:52:02Z
string preEncodedAuthRequest = "2009-04-01/CustomerAPIServicegetAvailableOfferings" + timeStamp;
MACSHA1 crypto = new HMACSHA1(System.Text.Encoding.Default.GetBytes("apiSecretKey"));
byte[] encodedBytes = crypto.ComputeHash(System.Text.Encoding.Default.GetBytes(preEncodedAuthRequest));
string hashedRequest = System.Convert.ToBase64String(encodedBytes);
DigitalChalk.Services.apiAuthenticationPacket authPacket = new DigitalChalk.Services.apiAuthenticationPacket();
authPacket.accessKey = apiPublicKey;
authPacket.signature = hashedRequest;
authPacket.timestamp = timeStamp;
DigitalChalk.Services.CustomerAPIServiceClient svc = new DigitalChalk.Services.CustomerAPIServiceClient();
DigitalChalk.Services.offeringListResult[] result = svc.getAvailableOfferings(authPacket);
Hope that helps any fellow devs out there. Code example is in C# on ASP.NET 3.5

about 2 years ago

about 2 years ago
This code saved me a ton of time. Thanks!
Does anyone know how to get the offering Id for a course? I can't seem to find it anywhere.

about 2 years ago
There are two methods in the DigitalChalk web services api that will allow you to get the offerings for registration. You can use the "getAvailableOfferings" call or the "getAvailableOfferingsForStudent" call. The first will return all available offerings in the organization and the second call will return those that are valid only for the user whose email address is provided.
- Ideas / Suggestions / Enhancements
04/26/2012 6:21 pm, 6 Responses - Can I have a large video/small slide chalkboard template?
02/16/2011 9:31 am, 4 Responses - Course Authoring on DigitalChalk
05/11/2011 9:33 am - Amazon Cloud Storage
05/08/2011 1:35 am, 1 Responses - general information about DigitalChalk
04/01/2011 5:55 am, 2 Responses
04/01/2011 5:50 am- Can I use PowerPoint/Keynote Presentations and keep all the animations?
02/23/2011 9:53 am - Previously Authored E-Learning
02/18/2011 10:08 pm, 2 Responses - Webservice API Hash/Auth Signature Details
12/22/2009 1:14 pm, 2 Responses - SCORM Certification
09/19/2010 1:21 pm, 2 Responses

