Attendance POST gives JSON error...HELP!
Having a really frustrating time trying to add an attendance entry to a test student. I'm using CURL, with the following request (edited only for security/privacy):
https://api.sky.blackbaud.com/school/v1/attendance
-X POST --header "Content-type: application/json" --header "Bb-Api-Subscription-Key: xxxxxxxxx" --header "Authorization: Bearer xxxxxxxxxxxx" --data-raw "{\\"begin_date\\":\\"2022-04-05T00:00:00-08:00\\",\\"end_date\\":\\"2022-04-05T00:00:00-08:00\\",\\"start_time\\":\\"00:00:00\\",\\"end_time\\":\\"23:59:00\\",\\"excuse_comment\\":\\"Testing\\",\\"excuse_type_id\\":3992,\\"student_user_id\\":444444}"
This generates the following unhelpful error message:
? * Line 1, Column 1
Syntax error: value, object or array expected.
* Line 1, Column 1
A valid JSON document must be either an array or an object value.
It doesn't matter how I massage the CURL Options - it keeps complaining that the JSON isn't properly formatted.
Any help figuring this out would be greatly appreciated!
Thank you.
Comments
-
And there's an error in the docs for the create attendance endpoint:
The sample data says:
{
"student_user_id": 10,
"begin_date": "2021-09-30T00:00:00Z",
"end_date": "2021-09-30T00:00:00Z",
"start_time": "2022-05-11",
"end_time": "2022-05-11",
"excuse_type_id": 153,
"excuse_comment": "College Trip"
}however "2022-05-11" is not a time.
0 -
And I've tried --data and a single quote enclosing the data doesn't work for my CURL.
This exact same CURL format (--data-raw and escaped quotes) works perfectly with Raiser's Edge, and other endpoints in School…
0 -
ARGH! I'm getting the error because I'm trying to parse a NULL response from SKY!
The error wasn't coming from my POST data - it was because it was added without error and (unlike other endpoints) doesn't give any sort of “success!" reply to a POST.
It would be awfully nice if SKY gave some sort of confirmation!
0 -
Hi Julian,
It is true that the POST attendance route does not return a JSON response, but it does return a HttpResponse of 200 on success. Many POST routes don't need to return any data on success and the HttpResponse is usually enough.
I found this on Stackoverflow, hopefully it helps!
https://stackoverflow.com/questions/29243587/curl-post-request-get-response-and-status-code
Best
Jared
0
Categories
- All Categories
- 6 Blackbaud Community Help
- 211 bbcon®
- 1.4K Blackbaud Altru®
- 402 Blackbaud Award Management™ and Blackbaud Stewardship Management™
- 1.1K Blackbaud CRM™ and Blackbaud Internet Solutions™
- 15 donorCentrics®
- 360 Blackbaud eTapestry®
- 2.6K Blackbaud Financial Edge NXT®
- 657 Blackbaud Grantmaking™
- 577 Blackbaud Education Management Solutions for Higher Education
- 3.2K Blackbaud Education Management Solutions for K-12 Schools
- 941 Blackbaud Luminate Online® and Blackbaud TeamRaiser®
- 84 JustGiving® from Blackbaud®
- 6.7K Blackbaud Raiser's Edge NXT®
- 3.7K SKY Developer
- 248 ResearchPoint™
- 120 Blackbaud Tuition Management™
- 165 Organizational Best Practices
- 240 Member Lounge (Just for Fun)
- 34 Blackbaud Community Challenges
- 37 PowerUp Challenges
- 3 (Open) PowerUp Challenge: Grid View Batch
- 3 (Closed) PowerUp Challenge: Chat for Blackbaud AI
- 3 (Closed) PowerUp Challenge: Data Health
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Product Update Briefing
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Standard Reports+
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Email Marketing
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Gift Management
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Event Management
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Home Page
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Standard Reports
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Query
- 796 Community News
- 3K Jobs Board
- 54 Blackbaud SKY® Reporting Announcements
- 47 Blackbaud CRM Higher Ed Product Advisory Group (HE PAG)
- 19 Blackbaud CRM Product Advisory Group (BBCRM PAG)
