Code Samples

Overview

SOCAN API’s are REST-based HTTP services that are built on top of the SOCAN API Enterprise system, our enterprise-class technology enables access to a wide variety of services. All API’s are easy to work with, supporting any programming language, using JSON. Below is a list of our API's with code samples of how you can call SOCAN’s API’s using C Sharp.  Will also include sample data that can be used to make requests to the sandbox. The API specifications can be found in the Documentation section.

API’s

Concert Performance (Notification of Live Performance (NLMP))

Code Sample for NLMP API - Last updated March 10, 2017

You can use the following JSON in a NLMP request. Data required is the date/Time of the performance, Venue details including name, address as well as the promoter name and contact.
Compositions are the songs performed with details such as title, and optional composer(s) (song writer)
Note: You will need to make an update to the date of the event so it is unique. Otherwise you will receive the duplication error code in the response.

{
   "MARIE_NO":"9999999",
   "CANADIAN_PERFORMANCE":"c",
   "TYPE_OF_PROGRAM":"sc",
   "ARTIST_NAME":"John Doe",
   "PROOF_TYPE":"contract",
   "DATE_OF_PROGRAM":"2017/01/01",
   "VENUE":"SOCAN",
   "VENUETYPE":"cfs",
   "VENUECAPACITY":"l5",
   "STREET1":"41 Valleybrook",
   "CITY":"Toronto",
   "PROVINCE":"ON",
   "POSTAL_CODE":"m3b 2s6",
   "COUNTRY":"can",
   "VENUE_PHONE":"4164458700",
   "VENUE_WEBSITE":"www.socan.ca",
   "PERFORMANCE_TIME":"1 : 30 pm",
   "PROMOTER":"SOCAN",
   "PROMOTER_STREET1":"41 Valleybrook",
   "PROMOTER_CITY":"Toronto",
   "PROMOTER_PROVINCE":"ON",
   "PROMOTER_POSTAL_CODE":"M3B2S6",
   "PROMOTER_COUNTRY":"CAN",
   "PROMOTER_TELEPHONE":"4164458700",
   "compositions":[
      { "ORIGINAL_TITLE":"SOCAN","COMPOSER":"John Doe" },
      { "ORIGINAL_TITLE":"HACKATHON","COMPOSER":"John Doe" }
   ]
}

 

Member Verification

Code Sample for Member Verification API - Last updated March 10, 2017

You would submit the request with JSON such as:

{ "IPI_NO":"999999999", "LEGAL_NAME":" WASKIM" }

You will receive a response with JSON verifying if the member exists:

{ "VerifiedMember": "YES" }

 

Join SOCAN

Code Sample for Join SOCAN API - Last updated March 10, 2017

The following test data can be used to submit a Join Request, you should ensure the credentials and email address are yours.

{
    "GIVEN_NAMES":"John",
    "MIDDLE_NAME":"S",
    "LAST_NAME":"Doe",
    "DATE_OF_BIRTH":"01/01/1990",
    "STREET1":"41 Valleybrook",
    "CITY":"Toronto",
    "PROVINCE":"ON",
    "COUNTRY":"CAN",
    "POSTAL_CODE":"M2M 2M2",
    "PHONE_NO1":"4164458700",
    "EMAIL_ADDRESS":"hackathon@socan.ca",
    "EMAIL_ADDRESS_VERIFY":"hackathon@socan.ca",
    "USER_ID":"hackathon_1",
    "PASSWORD":"hack123!",
    "PASSWORD_VERIFY":"hack123!",
    "HEAR_OF_SOCAN":"SOCAN",
    "LANGUAGE_PREFERENCE":"E",
    "TERMS":"Y"
}

 

Work Registration

The work registration process includes 3 API's, to submit a registration file, to retrieve the status of a submission and to retrieve the acknowledgement file for the works/file submitted.

Work Registration

Code Sample for Works API - Last updated March 10, 2017

The file template must be used to submit the works to the API. 

The files are language specific with heading in English or French and corresponding acknowledgement will be in that language. 

 

Sample template simple work.  You should update the title attribute in the file sample to make the work unique so it will be accepted.

English   or  French

Attach the file to the multipart request with  JSON  : 

{
    "MEMBER_NO":"9999999",
    "CONTACT_EMAIL":"hackathon@socan.ca",
    "CONTACT_NAME":"John Doe",
    "LANGUAGE":"E"
}

Note: You will have to update the contact email to receive emails.

 

Request Status

Code Sample for Status API - Last updated March 10, 2017

The following test data can be used to request the status of a work file submitted.

Individual File

{
   "API":"1001000",
   "MEMBER_NO":"9999999",
   "Type":"I",
   "CODE":"cw160083z99.xlsx"
}

List of Files

{
   "API":"1001000",
   "MEMBER_NO":"9999999",
   "Type":"L"
}

 

Acknowledgement

Code Sample for Acknowledgement API - Last updated March 10, 2017

The following test data can be used to request a acknowledgement file. A Excel file will be returned.

{
   "API":"1001000",
   "MEMBER_NO":"9999999",
   "CODE":"cw160089z99.xlsx"
}