REST API - Get a List of Objects
In this exercise you will retrieve a list of calendars. When you open the 4me REST API section in the 4me Developer Site you can find all the 4me record types in the right pane. For this exercise check the Calendars.
Can you retrieve a list of all calendars in the ‘Widget Data Center’ account? The ID of this account is ‘wdc’. Make sure to add the record type Calendar with Read access rights to the personal access token.
This is the CURL statement to list all calendars in the Widget Data Center Account.
curl -X GET -i -H "Authorization: Bearer <personal-token>" -H "X-4me-account: wdc" "https://api.4me-demo.com/v1/calendars"
Note that when you specify ‘widget’ in the account header, you will receive a ‘Not Found’ message because there are no calendars in a directory account. When you specify ‘weu-it’ in the account header, which is the account ID of the Widget Europe, Information Technology account, you will receive an ‘Unauthorized’ message. While Howard Tanner has the administrator role to the Widget Europe, Information Technology account and can see the calendars, in the personal access token we have specified that access is only given to the widget and wdc account.