JavaScript
import Mobilerun from '@mobilerun/sdk';
const client = new Mobilerun({
apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
});
const credential = await client.credentials.packages.credentials.create('x', {
credentialName: '26f1kl_-n-71',
fields: [{ fieldType: 'email', value: 'x' }],
});
console.log(credential.data);import os
from mobilerun_sdk import Mobilerun
client = Mobilerun(
api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"), # This is the default and can be omitted
)
credential = client.credentials.packages.credentials.create(
package_name="x",
credential_name="26f1kl_-n-71",
fields=[{
"field_type": "email",
"value": "x",
}],
)
print(credential.data)package main
import (
"context"
"fmt"
"github.com/stainless-sdks/droidrun-cloud-go"
"github.com/stainless-sdks/droidrun-cloud-go/option"
)
func main() {
client := mobileruncloud.NewClient(
option.WithAPIKey("My API Key"),
)
credential, err := client.Credentials.Packages.Credentials.New(
context.TODO(),
"x",
mobileruncloud.CredentialPackageCredentialNewParams{
CredentialName: "26f1kl_-n-71",
Fields: []mobileruncloud.CredentialPackageCredentialNewParamsField{{
FieldType: "email",
Value: "x",
}},
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", credential.Data)
}mobilerun-cloud credentials:packages:credentials create \
--api-key 'My API Key' \
--package-name x \
--credential-name 26f1kl_-n-71 \
--field '{fieldType: email, value: x}'curl --request POST \
--url https://api.mobilerun.ai/credentials/packages/{packageName} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"credentialName": "<string>",
"fields": [
{
"value": "<string>"
}
]
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mobilerun.ai/credentials/packages/{packageName}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'credentialName' => '<string>',
'fields' => [
[
'value' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.mobilerun.ai/credentials/packages/{packageName}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"credentialName\": \"<string>\",\n \"fields\": [\n {\n \"value\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mobilerun.ai/credentials/packages/{packageName}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"credentialName\": \"<string>\",\n \"fields\": [\n {\n \"value\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"data": {
"ownerId": "<string>",
"createdBy": "<string>",
"userId": "<string>",
"packageName": "<string>",
"secretPath": "<string>",
"credentialName": "<string>",
"fields": [
{
"value": "<string>"
}
]
}
}App Credentials
Create a credential
Creates a credential under the given package with a credentialName and at least one field. Each field has a fieldType (email, username, password, api_token, phone_number, two_factor_secret, or backup_codes) and a value.
POST
/
credentials
/
packages
/
{packageName}
JavaScript
import Mobilerun from '@mobilerun/sdk';
const client = new Mobilerun({
apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
});
const credential = await client.credentials.packages.credentials.create('x', {
credentialName: '26f1kl_-n-71',
fields: [{ fieldType: 'email', value: 'x' }],
});
console.log(credential.data);import os
from mobilerun_sdk import Mobilerun
client = Mobilerun(
api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"), # This is the default and can be omitted
)
credential = client.credentials.packages.credentials.create(
package_name="x",
credential_name="26f1kl_-n-71",
fields=[{
"field_type": "email",
"value": "x",
}],
)
print(credential.data)package main
import (
"context"
"fmt"
"github.com/stainless-sdks/droidrun-cloud-go"
"github.com/stainless-sdks/droidrun-cloud-go/option"
)
func main() {
client := mobileruncloud.NewClient(
option.WithAPIKey("My API Key"),
)
credential, err := client.Credentials.Packages.Credentials.New(
context.TODO(),
"x",
mobileruncloud.CredentialPackageCredentialNewParams{
CredentialName: "26f1kl_-n-71",
Fields: []mobileruncloud.CredentialPackageCredentialNewParamsField{{
FieldType: "email",
Value: "x",
}},
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", credential.Data)
}mobilerun-cloud credentials:packages:credentials create \
--api-key 'My API Key' \
--package-name x \
--credential-name 26f1kl_-n-71 \
--field '{fieldType: email, value: x}'curl --request POST \
--url https://api.mobilerun.ai/credentials/packages/{packageName} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"credentialName": "<string>",
"fields": [
{
"value": "<string>"
}
]
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mobilerun.ai/credentials/packages/{packageName}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'credentialName' => '<string>',
'fields' => [
[
'value' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.mobilerun.ai/credentials/packages/{packageName}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"credentialName\": \"<string>\",\n \"fields\": [\n {\n \"value\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mobilerun.ai/credentials/packages/{packageName}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"credentialName\": \"<string>\",\n \"fields\": [\n {\n \"value\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"data": {
"ownerId": "<string>",
"createdBy": "<string>",
"userId": "<string>",
"packageName": "<string>",
"secretPath": "<string>",
"credentialName": "<string>",
"fields": [
{
"value": "<string>"
}
]
}
}Authorizations
Bearer token via Authorization header
Path Parameters
Required string length:
1 - 200Body
application/json
Was this page helpful?
⌘I