API Create an Android keystore file

api
#1

How can i upload keystore file using PHP and guzzle?

$results = $this->client->request(‘POST’, $this->api . “apps/{$slug}/android-keystore-files”, [
‘headers’ => $this->getHeaders(),
‘multipart’ => [
[
‘name’ => ‘alias’,
‘contents’ => “alias”,
],
[
‘name’ => ‘password’,
‘contents’ => $password,
],
[
‘name’ => ‘private_key_password’,
‘contents’ => $key_password,
],
[
‘name’ => ‘upload_file_name’,
‘contents’ => “keystore”,
],
[
‘name’ => ‘upload_file_size’,
‘contents’ => $size,
],

				[
					'name'     => "keystore",
					'contents' => fopen( "keystore.file", 'r')
				]
			]

Got - {“message”:“Invalid request body, JSON decode failed”}
if send as
$data = [
‘headers’ => $this->getHeaders(),
‘json’ => $config
];
api returns success, row created, but file wasn’t loaded, because it missing in config.

0 Likes

#2

Hey there!

Could you please send us the URL of your build and enable Support Access so we can take a closer look? :slight_smile:

0 Likes

#3

I found here https://devcenter.bitrise.io/api/managing-ios-code-signing-files/ that I should to create file and response will contain upload url. After I got this url I should POST file to this url. I did it, but now i got another error:
Client error: POST https://concrete-userfiles-production.s3.us-west-2.amazonaws.com/... resulted in a 403 Forbidden response:

<?xml version="1.0" encoding="UTF-8"?>

SignatureDoesNotMatchThe request signature we calculated does not match the signature you provided. Check your key and signing method.
So i think i’m on right way.

0 Likes