LoopsAPI class

Find detailed Information about the API here: https://loops.so/docs/api-reference/api

Authencation

Get your Loops API Key -> https://loops.so/docs/api-reference/api#authentication

In your main method of your app write:

loopsAPIKey = "Your-API-Key-here";

FORGETTING THIS Will LEAD TO ERROR

It's reccommend to get your API Key from a .env file for more saftey. Don'f forget to put your .env under asset: in the pubspec.yaml if you want to get access on it.

Rate Limiting: (Taken from the docs)

To ensure the quality of service for all users, our API is rate limited. This means there’s a limit to the number of requests your application can make to our API in a certain time frame. The baseline rate limit is 10 requests per second per team.

The package has a backoff strategy implemeted. If the the rate limit is hit an API Request will delayed by 1 second and then will try to send again

Note though that this isn't 100% accurate and requests may fail sometimes. If you know that you very likley to use more than 10 API Requests per second ask the Loops Team to higher the limit -> https://loops.so/docs/api-reference/api#rate-limiting

Constructors

LoopsAPI()

Properties

authorization String
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

createContact({required String email, String? firstName, String? lastName, bool? subscribed = true, String? userGroup, String? userId, Map<String, dynamic>? customFields}) Future<void>
POST Request
deleteContact(String? email, String? userId) Future<void>
POST Request
findContact({required String email}) Future<void>
GET Request
listCustomFields() Future<void>
GET Request
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
sendEvent({required String email, required String eventName, Map<String, dynamic>? contactProperties}) Future<void>
POST Request
sendTransactionalEMail({required String email, required String transactionalId, dynamic dataVariables}) Future<void>
POST Request
toString() String
A string representation of this object.
inherited
updateContact({required String email, String? firstName, String? lastName, bool? subscribed = true, String? userGroup, String? userId, Map<String, dynamic>? customFields}) Future<void>
PUT Request

Operators

operator ==(Object other) bool
The equality operator.
inherited