MetaCopier
Open appSupport
  • 📄Documentation
  • 💟Introduction
  • Features
    • 💼Basic features
    • 🌟Pro features
    • 🔀Signal sharing
    • 🏎️HFT support
    • 💢Specifications
  • ⛳Pending orders
  • Tutorials
    • 🚀Quick start guide
    • 📈Set up strategy
    • ➡️Connect TradingView
    • 💰Prop firms guide
    • 🖥️For developers
    • 🔍Regex
    • ⏳Cron expressions
    • 🏠My home IP
  • B2B
    • 👨‍💼Business-to-Business
    • 🏷️White label
  • MetaCopier
    • 🧑‍🤝‍🧑Affiliate Program
    • Frequently Asked Questions (FAQ)
    • ⛑️Troubleshooting
    • 💠App
    • 💲Billing
    • 💳Payment methods
    • 🤝Support
    • 🚧Feature request
    • 🚀Release notes
  • REST API
    • ✨SDK
      • Usage
        • C#
        • Java
        • Typescript
        • Python
        • Other
      • Generation
    • 💡API
      • Swagger
      • Readme.io
    • 🗒️Changes
  • Socket API
    • 💡API
    • 🗒️Changes
Powered by GitBook
On this page
  • Create API Key from metacopier.io
  • Package Information
  • Install with Maven
  • Example Program
  • Generate your own package
  • What endpoints can I call?

Was this helpful?

  1. REST API
  2. SDK
  3. Usage

Java

Instructions on how to install and use the MetaCopier API Client package

PreviousC#NextTypescript

Last updated 5 months ago

Was this helpful?

Create API Key from metacopier.io

To generate yourself an API Key please navigate to metacopier.io > Your Projects > (Choose a project) > API Keys

Note: Please do not share your API Key to people whom you don't trust.

Package Information

The library is based on the following OpenAPI configuration:

Install with Maven

Add the following dependency to your pom.xml:

<dependency>
    <groupId>io.metacopier</groupId>
    <artifactId>api</artifactId>
    <version>0.9.0</version>
</dependency>

You can also visit the package on the official Maven Central Repository:

Example Program

Replace the "YOUR_API_KEY" with your own and run the code:

import io.metacopier.AccountApiApi;
import io.metacopier.api.ApiClient;
import io.metacopier.api.ApiException;
import io.metacopier.api.Configuration;
import io.metacopier.api.auth.ApiKeyAuth;
import io.metacopier.client.model.AccountDTO;

import java.util.List;

public class Main {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        defaultClient.setBasePath("https://api.metacopier.io");

        // Configure API key authorization: ApiKeyAuth
        ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth");
        ApiKeyAuth.setApiKey("YOUR_API_KEY");
        AccountApiApi apiInstance = new AccountApiApi(defaultClient);
        
        try {
            List<AccountDTO> results = apiInstance.getAccounts();
            System.out.println(results);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountApiApi#createAccount");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }

    }
}

Generate your own package

With the following command, you can generate your own package for the metacopier api:

Be sure that you have installed the OpenAPI Generator. See Generation page for more information.

openapi-generator-cli generate -i https://api.metacopier.io/rest/api/documentation/v3/api-docs -g java

For more information regarding the Open API generator, please visit their offical page:

What endpoints can I call?

To check all available endpoints see either of the two pages:

✨
Readme.io
Swagger
https://api.metacopier.io/rest/api/documentation/v3/api-docsapi.metacopier.io
Maven Central: io.metacopier:apiMaven Central
Logo
Hello from OpenAPI Generator | OpenAPI Generator
Logo