Overview
Introduction
Welcome to the CalCPA API! You can use our API to interact with various CPE Events in our system.
Authentication
To authorize, use this code:
# With shell, you can just pass the correct header with each request
curl "api_endpoint_here"
-H "Authorization:Basic CalCPA_API_KEY"
Make sure to replace
CalCPA_API_KEYwith your API key.
CalCPA uses Basic Auth over HTTPS for authentication. The username is your CalCPA API username and password. Unauthenticated requests will return an HTTP 401 response.
Authorization header
Most HTTP clients will automatically use a given username and password to generate the required Authorization header. However, you may need to explicity set this header. The header has the following format:
Authorization: Basic <base64("username:password")>
CalCPA API expects for the API username and password to be included in all API requests.
Versioning
We are at version 2.0
Errors
The CalCPA API uses the following error codes:
| Error Code | Meaning |
|---|---|
| 400 | Bad Request -- Something is incorrect with your request. Look for specific message. |
| 401 | Unauthorized -- Your API key is wrong. |
| 403 | Forbidden -- The server understood the request but refuses to authorize it. |
| 404 | Not Found -- The origin server did not find a current representation for the target resource. |
| 405 | Method Not Allowed -- The method received in the request-line is known by the origin server but not supported by the target resource. |
| 406 | Not Acceptable -- You requested a format that isn't json. |
| 410 | Gone -- TThe target resource is no longer available at the origin server. |
| 418 | I'm a teapot. |
| 429 | Too Many Requests -- The user has sent too many requests in a given amount of time ("rate limiting"). |
| 500 | Internal Server Error -- We had a problem with our server. Try again later. |
| 503 | Service Unavailable -- We're temporarily offline for maintenance. Please try again later. |
Registration API
Register
This endpoint registers a user for an event or cancels a user's existing event registration.
curl
--request POST
--url https://api.calcpa.org/register
--user CA:top_secret
--header "Content-Type: application/json"
--data {\"eventCode\":\"4193628G\",\"firstName\":\"dave\",\"middleName\":\"\",\"lastName\":\"tester\",\"email\":\"dave_test@mailinator.com\",\"state\":\"MA\",\"registrationType\":\"R\",\"registrationDate\":\"2020-02-24\"}
The above command takes a JSON request, structured like this:
{
"eventCode" : "4142366A",
"firstName": "Nikola",
"middleName" : "",
"lastName": "Tesla",
"suffix": "",
"email": "nikola.tesla@calcpa.org",
"birthDate": "",
"gender":"",
"state":"CO",
"licenseNumber":"",
"licenseDate":"",
"registrationType":"R",
"registrationDate":"2/15/2018",
"amount": 150.00
}
Example Response:
{
"status": 510,
"result": "AlreadyRegisteredForEvent"
}
HTTP Request
POST http://api.calcpa.org/register
URL Parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| EventCode | Yes | string | Event Code for the particular event |
| FirstName | Yes | string | First name of the registrant |
| MiddleName | No | string | Middle name or initial of the registrant |
| LastName | Yes | string | Last name of the registrant |
| Suffix | No | string | Suffix of the registrant |
| Yes | string | Email of the registrant | |
| BirthDate | No | string | Birth date of the registrant |
| Gender | No | string | Gender of the registrant |
| State | Yes | string | State of the registrant |
| LicenseNumber | No | string | CPA License Number of the registrant |
| LicenseDate | No | string | Liscenced date of the registrant within the state |
| RegistrationType | Yes | string | Type of Registration R = "Registration" or C = "Cancellation" |
| RegistrationDate | Yes | string | Date of Registration |
| Amount | No | money/decimal | Amount Paid |
Registration Error Messages
| Error Code | Error Message | Description |
|---|---|---|
| 510 | AlreadyRegisteredForEvent | User has already been registered for Event |
| 515 | EventNotAvailable | Event has not been setup properly. |
Register (Bulk)
This endpoint registers a set of users for events as a bulk operation.
curl
--request POST
--url https://api.calcpa.org/v2/register
--user CA:top_secret
--header "Content-Type: application/json"
--data [{\"eventCode\":\"4193628G\",\"firstName\":\"dave\",\"middleName\":\"\",\"lastName\":\"tester\",\"email\":\"dave_test@mailinator.com\",\"state\":\"MA\",\"registrationType\":\"R\",\"registrationDate\":\"2020-02-24\"}]
The above command takes a JSON request, structured like this:
[
{
"eventCode" : "4142366A",
"firstName": "Nikola",
"middleName" : "",
"lastName": "Tesla",
"suffix": "",
"email": "nikola.tesla@calcpa.org",
"birthDate": "",
"gender":"",
"state":"CO",
"licenseNumber":"",
"licenseDate":"",
"registrationType":"R",
"registrationDate":"2/15/2018",
"amount": 199.99
},
{
"eventCode" : "4142366A",
"firstName": "Albert",
"middleName" : "",
"lastName": "Einstein",
"suffix": "",
"email": "albert.einstein@calcpa.org",
"birthDate": "",
"gender":"",
"state":"CO",
"licenseNumber":"",
"licenseDate":"",
"registrationType":"R",
"registrationDate":"2/15/2018",
"amount": 100.00
}
]
Example Response:
{
"overallStatus": "Registration(s) processed successfully.",
"individualResults": [
{
"oosrNumber": 0,
"errorMessages": []
},
{
"oosrNumber": 1,
"errorMessages": []
}
],
"requestId": "c67076b3-6635-4948-9703-f8d74a3efd13"
}
HTTP Request
POST http://api.calcpa.org/v2/register
URL Parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| EventCode | Yes | string | Event Code for the particular event |
| FirstName | Yes | string | First name of the registrant |
| MiddleName | No | string | Middle name or initial of the registrant |
| LastName | Yes | string | Last name of the registrant |
| Suffix | No | string | Suffix of the registrant |
| Yes | string | Email of the registrant | |
| BirthDate | No | string | Birth date of the registrant |
| Gender | No | string | Gender of the registrant |
| State | Yes | string | State of the registrant |
| LicenseNumber | No | string | CPA License Number of the registrant |
| LicenseDate | No | string | Liscenced date of the registrant within the state |
| RegistrationType | Yes | string | Type of Registration must alwasy be "R" = "Registration" for bulk endpoint |
| RegistrationDate | Yes | string | Date of Registration |
| Amount | No | money/decimal | Amount Paid |
Registration Error Messages
| Error Code | Error Message | Description |
|---|---|---|
| 510 | AlreadyRegisteredForEvent | User has already been registered for Event |
| 515 | EventNotAvailable | Event has not been setup properly. |
Registration Reconciliation
This endpoint allows partner organizations to reconcile their members' event attendances with the CalCPA system.
curl
--request POST
--url https://api.calcpa.org/register/reconcile
--user CA:top_secret
--header "Content-Type: application/json"
--data "[{\"Id\":\"1047\",\"State\":\"CA\",\"EventCode\":\"4192877F\",\"EventTitle\":\"Webcast: What Every CPA Should Know About Fraud\",\"EventDate\":\"01\/10\/2020\",\"FirstName\":\"Gilbert\",\"MiddleName\":\"B.\",\"LastName\":\"Blumenthal\",\"Email\":\"phxmedi99r@aol.com\",\"Paid\": 160,\"Status\":\"Registered\"}]"
Example Request:
[
{
"State": "CA",
"EventCode": "1234567B",
"EventTitle": "Event Title",
"EventDate": "2019-12-04T09:12:26.7173516-08:00",
"FirstName": "FirstName",
"MiddleName": "Middle Name",
"LastName": "LastName",
"Email": "foo@example.com",
"Paid": 100.0,
"Status": "the status"
}
]
Example Response:
{
"message": "Inserted 1 records"
}
HTTP Request
POST http://api.calcpa.org/register/reconcile
URL Parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| State | Yes | string | State of the registrant |
| EventCode | Yes | string | Event Code for the particular event |
| EventTitle | Yes | string | Event Title |
| EventDate | Yes | DateTime | Event Date |
| FirstName: | Yes | string | Event Registrant First Name |
| MiddleName: | No | string | Event Registrant Middle Name |
| LastName: | Yes | string | Event Registrant Last Name |
| Yes | string | Event Registrant Email Address | |
| Paid | Yes | decimal | Amount Paid by Event Registrant |
| Status | Yes | string | Event Registration Status ("Registered" / "Cancelled") |
Attendance
This endpoint provides a report of Event Attendance information as recorded by the CalCPA system.
HTTP Request
GET https://api.calcpa.org/attendance\?fromUtc\=2019-11-06T14:30\&toUtc\=2019-11-08T14:30
curl
--request GET
--url https://api.calcpa.org/attendance?fromUtc=2020-06-01^&toUtc=2020-06-08
--user CA:top_secret
--header "Content-Type: application/json"
Example Request:
* This GET-only endpoint recognizes only URL Query Parameters and does not recognize Body Content
Example Response:
[
{
"YellowBookCreditHours": null,
"Id": "e1838271-2219-448b-a3a4-08d7a9a428d9",
"CustomerId": 1234567,
"FirstName": "Kaylie",
"MiddleName": "",
"LastName": "Sanchez",
"FullName": "Kaylie Sanchez",
"PrimaryEmail": "ksanchez@example.com",
"UsState": "AZ",
"Acronym": "ABCD",
"EventCode": "4183289C",
"StartDate": "2019-02-05T00:00:00",
"CreditsPossible": 2.0,
"CreditsEarned": 2.0,
"AttendanceLevel": "FullCredit",
"EventReconciled": "2019-02-06T14:04:14.357",
"AccountingAndAuditingCreditHours": "",
"MinContinuingLegalEducationCreditHours": "",
"RegulatoryReviewCreditHours": null,
"TaxationLawCreditHours": null,
"CertifiedFinancialPlannerCreditHours": null,
"CTECCaliforniaCreditHours": null,
"CTECFederalCreditHours": null,
"CTECEthicsCreditHours": null,
"EstatePlanTrustCreditHours": null,
"EthicsCreditHours": null,
"FamilyLawCreditHours": 0.0,
"FraudCreditHours": null,
"GovernmentCreditHours": null,
"IRSEthicsCreditHours": null,
"IRSTaxCreditHours": null
}
]
| Parameter | Required | Type | Description |
|---|---|---|---|
| fromUtc | Yes | DateTime | Starting date range for data to be returned |
| toUtc | Yes | DateTime | Ending date range for data to be returned |
Update User Email Address
Updates an existing user's email address in the CalCPA system.
HTTP Request
PUT https://api.calcpa.org/user/email
curl
--request PUT
--url https://api.calcpa.org/user/email
--user CA:top_secret
--header "Content-Type: application/json"
--data {\"PartnerAbbreviation\":\"CA\",\"OldEmail\":\"old@example.com\",\"NewEmail\":\"new@example.com\"}
Example Request:
{
"PartnerAbbreviation": "CA",
"OldEmail": "old@example.com",
"NewEmail": "new@example.com"
}
Example Response:
{
"message": "Request received. Our staff has been notified and the request will be processed pending review."
}
| Parameter | Required | Type | Description |
|---|---|---|---|
| fromUtc | Yes | DateTime | Starting date range for data to be returned |
| toUtc | Yes | DateTime | Ending date range for data to be returned |
Self-Study API
Self-Study
This endpoint is used for purchasing self-study materials.
curl
--request POST
--url https://api.calcpa.org/selfstudy
--user CA:top_secret
--header "Content-Type: application/json"
--data {\"productCode\":\"MYOOD16\",\"firstName\":\"dave\",\"middleName\":\"\",\"lastName\": \"tester\",\"email\":\"dave444@mailinator.com\",\"state\":\"MA\"}
The above command takes a JSON request, structured like this:
{
"productCode": "MYOOD16",
"firstName": "dave",
"middleName": "",
"lastName": "tester",
"email": "dave444@mailinator.com",
"state": "MA",
"amount": 150.00
}
Example Response:
{"ConfirmationNumber":"1615158"}
HTTP Request
POST http://api.calcpa.org/selfstudy
URL Parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| ProductCode | Yes | string | Product Code for the self-study item |
| FirstName | Yes | string | First name of the registrant |
| MiddleName | No | string | Middle name or initial of the registrant |
| LastName | Yes | string | Last name of the registrant |
| Yes | string | Email of the registrant | |
| BirthDate | No | string | Birth date of the registrant |
| Gender | No | string | Gender of the registrant |
| State | Yes | string | State of the registrant |
| LicenseNumber | No | string | CPA License Number of the registrant |
| LicenseDate | No | string | Liscenced date of the registrant within the state |
| Amount | No | money/decimal | Amount Paid |