# API Create an Android keystore file

**URL:** https://discuss.bitrise.io/t/api-create-an-android-keystore-file/11881
**Category:** Question & Answer
**Tags:** api
**Created:** [February 10, 2020, 1:29pm UTC](https://discuss.bitrise.io/t/api-create-an-android-keystore-file/11881 "2020-02-10T13:29:12Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![anton.g](https://avatars.discourse-cdn.com/v4/letter/a/9e8a1a/32.png) [@anton.g](https://discuss.bitrise.io/u/anton.g)
#### Post date: [February 10, 2020, 1:29pm UTC](https://discuss.bitrise.io/t/api-create-an-android-keystore-file/11881/1 "2020-02-10T13:29:12Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Roland-Bak](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/roland-bak/32/3480_2.png) [@Roland-Bak](https://discuss.bitrise.io/u/Roland-Bak)
#### Post date: [February 11, 2020, 9:04am UTC](https://discuss.bitrise.io/t/api-create-an-android-keystore-file/11881/2 "2020-02-11T09:04:03Z")

</div>

Hey there!

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

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex016/uploads/bitrise/original/2X/d/d901cf2aad020f2dd11918afc89ec2089bb87b35.png) [@system](https://discuss.bitrise.io/u/system)
#### Post date: [March 12, 2020, 11:57am UTC](https://discuss.bitrise.io/t/api-create-an-android-keystore-file/11881/4 "2020-03-12T11:57:39Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
