Bridge API

A simple API client for Bridge LMS


To create a new client:

client = "your bridge api token", prefix: "")


client = "your bridge api key", api_secret:
"your bridge api secret", prefix: "")

Additional options

Rate Limiting

If you are using BridgeAPI in a multi-threaded environment where you are instantiating several instances of client, you can also supply your client initializer with master_rate_limit: true. This will use a redis keystore to track your rate limits across all instances of client and properly throttle your application as needed.

Token Pools

This supports token pooling to get around rate limiting issues in bridge (but should never be used without Core approval) To use with Tokens:

client = ['token1', 'token2'], prefix: "")

To use with API Keys:

client = {'key1' => 'secret1', 'key2' => 'secret2'}, prefix: "")

The logic will start with the first token provided, and check against the redis cache to see what its current limit is. If its already under the limit threshold, it will rotate to the next in the pool, and perform the same check. It will do this till it finds one that is not under the threshold, and use it. If none are found, it will sleep for the configured time, and then try to make a call.