Uploading Applications to Your Project
To upload applications in your project, you need to send a POST request to the endpoint /api/v1/applications/new.
Optional Parameters
You can add optional parameters to the API end point:
Parameter | Value | Description |
---|---|---|
camera | true / false | The application will include camera libraries |
touchId | true / false | The application will include touch id libraries |
uniqueName | string | String that the you can use later to identify the app uniquely |
Example:
/api/v1/applications/new?camera=true&touchId=true&uniqueName=uniqueName
See below for code examples on how to upload applications.
Java
You need the OKHttpClient library. You can get from Maven (if you use maven or gradle).
Upload Applications with Java Expand source
import okhttp3.*;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
public class Applications {
@Test
public void uploadApp() throws IOException {
OkHttpClient client = new OkHttpClient();
File app = new File("<PATH_TO_FILE>");
RequestBody formBody = new MultipartBody.Builder()
.setType(MultipartBody.FORM)
.addFormDataPart("file", app.getName(),
RequestBody.create(MediaType.parse("text/plain"), app))
.addFormDataPart("other_field", "other_field_value")
.build();
Request request = new Request.Builder()
.url("https://cloud.seetest.io/api/v1/applications/new")
.post(formBody)
.addHeader("Content-Type", "application/x-www-form-urlencoded")
.addHeader("Cache-Control", "no-cache")
.addHeader("Authorization", "Bearer <ACCESS_KEY>")
.build();
Response response = client.newCall(request).execute();
System.out.println(response);
}
}
Python
For this code to run, you need the Requests package You can get it by running the command
pip install requests
Upload Applications with Python Expand source
import requests
url = "https://cloud.seetest.io/api/v1/applications/new"
headers = {
'Authorization': "Bearer <ACCESS_KEY>",
}
app = open('<PATH_TO_FILE>','rb')
files = {'file': app}
requests.post(url, files=files, headers=headers)
C#
For this code to run, you need the RestSharp library. You can get it by running the command (in NuGet Package Manager)
Install-Package RestSharp
Upload Applications with C Sharp Expand source
using RestSharp;
using System;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
var client = new RestClient("https://cloud.seetest.io/api/v1/applications/new");
RestRequest restRequest = new RestRequest(Method.POST);
restRequest.RequestFormat = DataFormat.Json;
restRequest.AddHeader("Authorization", "Bearer <ACCESS_KEY>");
restRequest.AddFile("file", "<PATH_TO_APP>");
var response = client.Execute(restRequest);
Console.WriteLine(response.Content);
}
}
}
Ruby
For this code to run, you need the ruby's rest-client package You can get it by running the command
gem install rest-client
Upload Applications with Ruby Expand source
require 'rest-client'
url = 'https://cloud.seetest.io/api/v1/applications/new'
auth = 'Bearer <ACCESS_KEY>'
payload = {
:multipart => true,
:file => File.new('PATH_TO_FILE', 'rb')
}
response = RestClient.post(url, payload,
:authorization => auth)