[ARCHIVED] Unexpected String in the middle of Returned JSON (from cURL users)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2021
03:10 PM
Hi, I used the ShellScript cURL method to get a list of the users in the course.
This is my script:
curl <https://$schoolname.instructure.com/api/v1/courses/$MyCourseID/users \
-X GET \
-d per_page=100 \
-d enrollment_type[]=student \
-H "Authorization: Bearer $MyToken"
I get the returned string, formatted as
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 38 0 0 100 38 0 39 --:--:-- --:--:-- --:--:-- 38[{"id":2766,"name":"C A","created_at":"2016-09-14T18:39:02-04:00","sortable_name":"A, B ","short_name":"B A","sis_user_id":"218850","integration_id":null,"login_id":"ca50","email":"ca50@aaa.edu"},
...
...
{"id":29909,"name":"K J ","created_at":"2020-03-09T10:00:04-04:00
100 29977 0 29939 100 38 27876 35 0:00:01 0:00:","sortable_name":"J, W","short_name":"W J ","sis_user_id":"235251","integration_id":null,"login_id":"kj51","email":"kj51@aaa.edu"},
...
...
...
{"id":451,"name":"C R","created_at":"2016-09-14T18:34:35-04:00","sortable_name":"R, C","short_name":"C R","sis_user_id":"185511","integration_id":null,"login_id":"CR11","email":"cr@aaa.edu"}]01 --:--:-- 27911
But there is an expected string in the middle.
100 29977 0 29939 100 38 27876 35 0:00:01 0:00:
It begins with a carriage return "\r".
It is more visible in BBEdit (shwon as an upside down question mark "?"):
What is the cause of it and how can I get rid of it?
Thanks!
This discussion post is outdated and has been archived. Please use the Community question forums and official documentation for the most current and accurate information.