In the 2.0 version of Context.IO an account must perform an initial historical sync before data becomes available in the API.
This initial historical sync can take up to 30 minutes or more depending on the size of the account. Messages should become available in the API as the sync progresses, but there may be some cases where you get back an empty array from a GET messages call if we have not synced anything in the account yet.
How do I know the initial sync has completed?
When you add a source, you can specify a "callback_url" (different than "status_callback_url"). If specified, we'll make a POST request to this URL when the initial sync is completed.
Documentation for this endpoint and parameter can be found here: https://context.io/docs/2.0/accounts/sources#post
Please note: If adding an account via connect_tokens, the callback_url parameter becomes "source_callback_url", as the callback_url used in connect_tokens refers to the url where we redirect the user to after authentication. Documentation on this endpoint here: https://context.io/docs/2.0/connect_tokens#post
After an account has finished the initial sync, the sync status should say "on continuous sync".