api-integration

pluginagentmarketplace's avatarfrom pluginagentmarketplace

Retrofit, OkHttp, REST APIs, JSON serialization, network security. Use when making HTTP requests and integrating APIs.

⭐0stars🔀0forks📁View on GitHub🕐Updated Nov 19, 2025

When & Why to Use This Skill

This Claude skill streamlines network communication and API integration by leveraging industry-standard tools like Retrofit and OkHttp. It provides comprehensive support for building type-safe RESTful clients, implementing robust error handling, and ensuring network security through SSL pinning and TLS enforcement, making it an essential tool for modern software development.

Use Cases

  • Rapidly bootstrapping type-safe REST API clients using Retrofit interfaces and automated JSON serialization.
  • Enhancing application security by configuring OkHttp with SSL pinning, certificate validation, and secure token storage.
  • Implementing resilient networking layers with standardized error handling, exponential backoff retries, and detailed request/response logging.
  • Optimizing data exchange through efficient HTTP method implementation (GET, POST, PUT, DELETE) and caching strategies.
namenetworking
descriptionRetrofit, OkHttp, REST APIs, JSON serialization, network security.
version"2.0.0"
sasmp_version"1.3.0"
bonded_agent05-networking
bond_typePRIMARY_BOND
atomictrue
single_responsibilityHTTP networking & API integration
typestring
enum[setup, error_handling, security, caching]
defaultrest
requiredfalse
max_attempts3
backoffexponential
on_failureprovide_fallback_pattern
levelinfo
include[api_endpoint, response_code, latency]

API Integration Skill

Quick Start

Retrofit Setup

interface UserApi {
    @GET("/users/{id}")
    suspend fun getUser(@Path("id") id: Int): UserDto
    
    @POST("/users")
    suspend fun createUser(@Body user: UserDto): UserDto
}

val retrofit = Retrofit.Builder()
    .baseUrl("https://api.example.com/")
    .addConverterFactory(GsonConverterFactory.create())
    .build()

val api = retrofit.create(UserApi::class.java)

OkHttp Configuration

val client = OkHttpClient.Builder()
    .addInterceptor(HttpLoggingInterceptor())
    .connectTimeout(30, TimeUnit.SECONDS)
    .certificatePinner(CertificatePinner.Builder()
        .add("api.example.com", "sha256/...").build())
    .build()

Error Handling

sealed class Result<T> {
    data class Success<T>(val data: T) : Result<T>()
    data class Error<T>(val exception: Exception) : Result<T>()
}

Key Concepts

HTTP Methods

  • GET: Fetch data
  • POST: Create resource
  • PUT/PATCH: Update
  • DELETE: Remove

Retrofit Features

  • Type-safe interfaces
  • Automatic serialization
  • Suspend function support
  • Error callbacks

Network Security

  • HTTPS/TLS enforcement
  • SSL pinning
  • Certificate validation
  • Secure token storage

Best Practices

✅ Use HTTPS always ✅ Implement SSL pinning ✅ Handle errors gracefully ✅ Optimize request/response size ✅ Cache when possible

Resources