Fetching next page of constituents returns "InvalidSortTokenValueFormat" for sort_token field
I'm trying to implement a simple fetch-all script to get all the Constituent records from one of our customers accounts. First page of results contains a "next_link" value in it's payload which i'm also using to fetch a second page of constituents but doing so results in API returning 400 error with a following content:
[
{
"message": "The provided sort token's format is invalid.",
"error_name": "InvalidSortTokenValueFormat",
"error_code": 14,
"raw_message": "The provided sort token's format is invalid."
}
]
I'm pretty concerned by this as i'm using the exact sort_token returned by a first page request. Request URL looks as follows:
https://api.sky.blackbaud.com/constituent/v1/constituents?fields=id%25252Cdate_added%25252Cemail%25252Cname%25252Cphone%25252Ctype%25252Clookup_id&include_deceased=False&include_inactive=False&sort_token=ew0KICAiRGF0ZSI6IG51bGwsDQogICJJZCI6ICIxMzc1IiwNCiAgIkNvbHVtbiI6IDQzLA0KICAiRGlyZWN0aW9uIjogMA0KfQ==
I also tried url-escaping the == chars which resulted in a following url:
https://api.sky.blackbaud.com/constituent/v1/constituents?fields=id%25252Cdate_added%25252Cemail%25252Cname%25252Cphone%25252Ctype%25252Clookup_id&include_deceased=False&include_inactive=False&sort_token=ew0KICAiRGF0ZSI6IG51bGwsDQogICJJZCI6ICIxMzc1IiwNCiAgIkNvbHVtbiI6IDQzLA0KICAiRGlyZWN0aW9uIjogMA0KfQ%3d%3d
And a following error:
[
{
"message": "The field 'sort_token' contains invalid data.",
"error_name": "InvalidData",
"error_code": 400,
"raw_message": "The field 'sort_token' contains invalid data.",
"error_args": [
]
}
]
Any idea what am i doing wrong in here? Thanks in advance for any clues.
Comments
-
Hey Brendan,
This is Chris with the SKY API team. I dug into your issue a bit, and from what I can tell, you've discovered an issue on our side. It appears that your sort_token is indicating that the list should be sorted by the constituent's last modified date; however, because that particular field (date_modified) was not included in your fields query parameter, the sort token from your previous request wasn't built correctly. I'm going to get this issue filed with our team.
In the meantime, please discard the sort token and perform your original API request again. This time, to get a valid next link & sort_token, you can either remove the fields query parameter completely or update the fields query parameter to include the date_modified field:
fields=date_added,date_modified,email,name,phone,type,lookup_id
Sorry for the inconvenience there. Let me know if that doesn't resolve the issue for you.0 -
Update: The issue Brendan reported has been resolved. The workaround I described in my previous post is no longer necessary. Please follow up on this thread if you're still encountering this problem. Thanks!0
Categories
- All Categories
- 6 Blackbaud Community Help
- 213 bbcon®
- 1.4K Blackbaud Altru®
- 401 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®
- 655 Blackbaud Grantmaking™
- 576 Blackbaud Education Management Solutions for Higher Education
- 3.2K Blackbaud Education Management Solutions for K-12 Schools
- 939 Blackbaud Luminate Online® and Blackbaud TeamRaiser®
- 84 JustGiving® from Blackbaud®
- 6.6K Blackbaud Raiser's Edge NXT®
- 3.7K SKY Developer
- 248 ResearchPoint™
- 119 Blackbaud Tuition Management™
- 165 Organizational Best Practices
- 241 Member Lounge (Just for Fun)
- 34 Blackbaud Community Challenges
- 34 PowerUp Challenges
- 3 (Open) 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
- 791 Community News
- 2.9K Jobs Board
- 53 Blackbaud SKY® Reporting Announcements
- 47 Blackbaud CRM Higher Ed Product Advisory Group (HE PAG)
- 19 Blackbaud CRM Product Advisory Group (BBCRM PAG)
