apps/add_app

Adding applications by store id or bundle id

Parameters

Name Type Description Required
platform string app platform. Can be "ios" or "android" +
store_id string app id in Google play or Apple App store, for example "id293405659" or "293405659" or "com.devuni.flashlight". Use for released apps only instead of bundle_id +
bundle_id string Bundle Id in Google play or Apple App store. Use for apps in development only instead of store_id +

store_id Example

curl -H "Access-Token: e33e0c9b00fac086da21c46e5ffe997f497b80dc" -H "Client-Id: 5b2e877f-1004-4895-b7db-d869ab7c9d4b" -s -X PUT 'https://adcel.co/api/apps/add_app' -d '{"platform": "ios", "store_id": "520674307"}'
copy

bundle_id Example

curl -H "Access-Token: e33e0c9b00fac086da21c46e5ffe997f497b80dc" -H "Client-Id: 5b2e877f-1004-4895-b7db-d869ab7c9d4b" -s -X PUT 'https://adcel.co/api/apps/add_app' -d '{"platform": "ios", "bundle_id": "com.app.test"}'
copy

Response

{"result":{"app_id":"68097b49-f891-47ea-b59c-fedbfd0321dc","key":"68097b49-f891-47ea-b59c-fedbfd0321dc:*"}}
copy

store_id Example In Java


HttpURLConnection urlConnection = null;
try {
    // create connection
    URL url = new URL("https://adcel.co/api/apps/add_app");
    urlConnection = (HttpURLConnection) url.openConnection();
    urlConnection.setRequestMethod("PUT");
    urlConnection.setRequestProperty("Access-Token", <access token, can be obtained in profile>);
    urlConnection.setRequestProperty("Client-Id", <user_uuid, can be obtained in profile>);

    urlConnection.setDoOutput(true);
    OutputStreamWriter out = new OutputStreamWriter(urlConnection.getOutputStream());
    out.write(String.format("{\"platform\":\"%1$s\",\"store_id\":\"%2$s\"}", <platform>, <store app id >));
    out.close();

    Log.v("###addApp###", "httpStatus " + urlConnection.getResponseCode());
    InputStream in = new BufferedInputStream(urlConnection.getInputStream());

    StringBuilder responseText  = new StringBuilder();
    String inputLine = null;
    BufferedReader reader = new BufferedReader(new InputStreamReader(in));
    while ((inputLine = reader.readLine()) != null) {
        responseText.append(inputLine);
    }
    reader.close();
    Log.v("###addApp###", "httpResponse " + responseText.toString());
} catch (MalformedURLException e) {
    e.printStackTrace();
} catch (SocketTimeoutException e) {
    e.printStackTrace();
} catch (IOException e) {
    e.printStackTrace();
} finally {
    if (urlConnection != null) {
        urlConnection.disconnect();
    }
}
copy

bundle_id Example In Java


HttpURLConnection urlConnection = null;
try {
    // create connection
    URL url = new URL("https://adcel.co/api/apps/add_app");
    urlConnection = (HttpURLConnection) url.openConnection();
    urlConnection.setRequestMethod("PUT");
    urlConnection.setRequestProperty("Access-Token", <access token, can be obtained in profile>);
    urlConnection.setRequestProperty("Client-Id", <user_uuid, can be obtained in profile>);

    urlConnection.setDoOutput(true);
    OutputStreamWriter out = new OutputStreamWriter(urlConnection.getOutputStream());
    out.write(String.format("{\"platform\":\"%1$s\",\"bundle_id\":\"%2$s\"}", <platform>, <app id>));
    out.close();

    Log.v("###addApp###", "httpStatus " + urlConnection.getResponseCode());
    InputStream in = new BufferedInputStream(urlConnection.getInputStream());

    StringBuilder responseText  = new StringBuilder();
    String inputLine = null;
    BufferedReader reader = new BufferedReader(new InputStreamReader(in));
    while ((inputLine = reader.readLine()) != null) {
        responseText.append(inputLine);
    }
    reader.close();
    Log.v("###addApp###", "httpResponse " + responseText.toString());
} catch (MalformedURLException e) {
    e.printStackTrace();
} catch (SocketTimeoutException e) {
    e.printStackTrace();
} catch (IOException e) {
    e.printStackTrace();
} finally {
    if (urlConnection != null) {
        urlConnection.disconnect();
    }
}
copy