Welcome to the MagicbellUserClient SDK documentation. This guide will help you get started with integrating and using the MagicbellUserClient SDK in your project.
- API version:
2.0.0
- SDK version:
0.2.0
OpenAPI 3.0.3 Specification for MagicBell API.
This SDK is compatible with the following versions: Java >= 1.8
If you use Maven, place the following within the dependency tag in your pom.xml
file:
<dependency>
<groupId>com.magicbell</groupId>
<artifactId>magicbell-user-client</artifactId>
<version>0.2.0</version>
</dependency>
If you use Gradle, paste the next line inside the dependencies block of your build.gradle
file:
implementation group: com.magicbell, name: magicbell-user-client, version: 0.2.0
If you use JAR files, package the SDK by running the following command:
mvn compile assembly:single
Then, add the JAR file to your project's classpath.
The MagicbellUserClient API uses an Access Token for authentication.
This token must be provided to authenticate your requests to the API.
When you initialize the SDK, you can set the access token as follows:
import com.magicbell.magicbelluserclient.MagicbellUserClient;
import com.magicbell.magicbelluserclient.config.MagicbellUserClientConfig;
public class Main {
public static void main(String[] args) {
MagicbellUserClientConfig config = MagicbellUserClientConfig.builder().accessToken("YOUR_ACCESS_TOKEN").build();
MagicbellUserClient magicbellUserClient = new MagicbellUserClient(config);
}
}
If you need to set or update the access token after initializing the SDK, you can use:
magicbellUserClient.setAccessToken('YOUR_ACCESS_TOKEN');
You can set a custom timeout for the SDK's HTTP requests as follows:
import com.magicbell.magicbelluserclient.MagicbellUserClient;
import com.magicbell.magicbelluserclient.config.MagicbellUserClientConfig;
public class Main {
public static void main(String[] args) {
MagicbellUserClientConfig config = MagicbellUserClientConfig.builder().timeout(10000).build();
MagicbellUserClient magicbellUserClient = new MagicbellUserClient(config);
}
}
Below is a comprehensive example demonstrating how to authenticate and call a simple endpoint:
import com.magicbell.magicbelluserclient.MagicbellUserClient;
import com.magicbell.magicbelluserclient.config.MagicbellUserClientConfig;
import com.magicbell.magicbelluserclient.models.ArrayOfMetadataApnsTokens;
import com.magicbell.magicbelluserclient.models.GetMobilePushApnsTokensParameters;
public class Main {
public static void main(String[] args) {
MagicbellUserClientConfig config = MagicbellUserClientConfig.builder().accessToken("YOUR_ACCESS_TOKEN").build();
MagicbellUserClient magicbellUserClient = new MagicbellUserClient(config);
GetMobilePushApnsTokensParameters requestParameters = GetMobilePushApnsTokensParameters
.builder()
.pageSize(8L)
.pageAfter("page[after]")
.pageBefore("page[before]")
.build();
ArrayOfMetadataApnsTokens response = magicbellUserClient.channels.getMobilePushApnsTokens(requestParameters);
System.out.println(response);
}
}
The SDK provides various services to interact with the API.
Below is a list of all available services with links to their detailed documentation:
Name |
---|
ChannelsService: [Java] [Kotlin] |
IntegrationsService: [Java] [Kotlin] |
The SDK includes several models that represent the data structures used in API requests and responses. These models help in organizing and managing the data efficiently.
Below is a list of all available models with links to their detailed documentation:
This SDK is licensed under the MIT License.
See the LICENSE file for more details.