Complete and push
curl --request POST \
--url https://user.pmock.com/api/open/api/phone/completeAndPush \
--header 'Content-Type: application/json' \
--data '
{
"phoneId": 123,
"pushDestDir": "<string>",
"uploadId": "<string>",
"fileName": "<string>",
"fileSize": 123,
"liveImageUrl": "<string>",
"uploadType": 123,
"mergeList": [
{
"etag": "<string>",
"partNumber": 1
}
]
}
'import requests
url = "https://user.pmock.com/api/open/api/phone/completeAndPush"
payload = {
"phoneId": 123,
"pushDestDir": "<string>",
"uploadId": "<string>",
"fileName": "<string>",
"fileSize": 123,
"liveImageUrl": "<string>",
"uploadType": 123,
"mergeList": [
{
"etag": "<string>",
"partNumber": 1
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
phoneId: 123,
pushDestDir: '<string>',
uploadId: '<string>',
fileName: '<string>',
fileSize: 123,
liveImageUrl: '<string>',
uploadType: 123,
mergeList: [{etag: '<string>', partNumber: 1}]
})
};
fetch('https://user.pmock.com/api/open/api/phone/completeAndPush', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://user.pmock.com/api/open/api/phone/completeAndPush",
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([
'phoneId' => 123,
'pushDestDir' => '<string>',
'uploadId' => '<string>',
'fileName' => '<string>',
'fileSize' => 123,
'liveImageUrl' => '<string>',
'uploadType' => 123,
'mergeList' => [
[
'etag' => '<string>',
'partNumber' => 1
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://user.pmock.com/api/open/api/phone/completeAndPush"
payload := strings.NewReader("{\n \"phoneId\": 123,\n \"pushDestDir\": \"<string>\",\n \"uploadId\": \"<string>\",\n \"fileName\": \"<string>\",\n \"fileSize\": 123,\n \"liveImageUrl\": \"<string>\",\n \"uploadType\": 123,\n \"mergeList\": [\n {\n \"etag\": \"<string>\",\n \"partNumber\": 1\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://user.pmock.com/api/open/api/phone/completeAndPush")
.header("Content-Type", "application/json")
.body("{\n \"phoneId\": 123,\n \"pushDestDir\": \"<string>\",\n \"uploadId\": \"<string>\",\n \"fileName\": \"<string>\",\n \"fileSize\": 123,\n \"liveImageUrl\": \"<string>\",\n \"uploadType\": 123,\n \"mergeList\": [\n {\n \"etag\": \"<string>\",\n \"partNumber\": 1\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://user.pmock.com/api/open/api/phone/completeAndPush")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"phoneId\": 123,\n \"pushDestDir\": \"<string>\",\n \"uploadId\": \"<string>\",\n \"fileName\": \"<string>\",\n \"fileSize\": 123,\n \"liveImageUrl\": \"<string>\",\n \"uploadType\": 123,\n \"mergeList\": [\n {\n \"etag\": \"<string>\",\n \"partNumber\": 1\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"traceId": "<string>",
"code": 123,
"msg": "<string>",
"status": "finish",
"data": {
"phoneId": 123,
"envFileId": 123,
"taskId": 123
}
}File & App
Complete and push
merge shards&push to mobile phone
POST
/
open
/
api
/
phone
/
completeAndPush
Complete and push
curl --request POST \
--url https://user.pmock.com/api/open/api/phone/completeAndPush \
--header 'Content-Type: application/json' \
--data '
{
"phoneId": 123,
"pushDestDir": "<string>",
"uploadId": "<string>",
"fileName": "<string>",
"fileSize": 123,
"liveImageUrl": "<string>",
"uploadType": 123,
"mergeList": [
{
"etag": "<string>",
"partNumber": 1
}
]
}
'import requests
url = "https://user.pmock.com/api/open/api/phone/completeAndPush"
payload = {
"phoneId": 123,
"pushDestDir": "<string>",
"uploadId": "<string>",
"fileName": "<string>",
"fileSize": 123,
"liveImageUrl": "<string>",
"uploadType": 123,
"mergeList": [
{
"etag": "<string>",
"partNumber": 1
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
phoneId: 123,
pushDestDir: '<string>',
uploadId: '<string>',
fileName: '<string>',
fileSize: 123,
liveImageUrl: '<string>',
uploadType: 123,
mergeList: [{etag: '<string>', partNumber: 1}]
})
};
fetch('https://user.pmock.com/api/open/api/phone/completeAndPush', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://user.pmock.com/api/open/api/phone/completeAndPush",
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([
'phoneId' => 123,
'pushDestDir' => '<string>',
'uploadId' => '<string>',
'fileName' => '<string>',
'fileSize' => 123,
'liveImageUrl' => '<string>',
'uploadType' => 123,
'mergeList' => [
[
'etag' => '<string>',
'partNumber' => 1
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://user.pmock.com/api/open/api/phone/completeAndPush"
payload := strings.NewReader("{\n \"phoneId\": 123,\n \"pushDestDir\": \"<string>\",\n \"uploadId\": \"<string>\",\n \"fileName\": \"<string>\",\n \"fileSize\": 123,\n \"liveImageUrl\": \"<string>\",\n \"uploadType\": 123,\n \"mergeList\": [\n {\n \"etag\": \"<string>\",\n \"partNumber\": 1\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://user.pmock.com/api/open/api/phone/completeAndPush")
.header("Content-Type", "application/json")
.body("{\n \"phoneId\": 123,\n \"pushDestDir\": \"<string>\",\n \"uploadId\": \"<string>\",\n \"fileName\": \"<string>\",\n \"fileSize\": 123,\n \"liveImageUrl\": \"<string>\",\n \"uploadType\": 123,\n \"mergeList\": [\n {\n \"etag\": \"<string>\",\n \"partNumber\": 1\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://user.pmock.com/api/open/api/phone/completeAndPush")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"phoneId\": 123,\n \"pushDestDir\": \"<string>\",\n \"uploadId\": \"<string>\",\n \"fileName\": \"<string>\",\n \"fileSize\": 123,\n \"liveImageUrl\": \"<string>\",\n \"uploadType\": 123,\n \"mergeList\": [\n {\n \"etag\": \"<string>\",\n \"partNumber\": 1\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"traceId": "<string>",
"code": 123,
"msg": "<string>",
"status": "finish",
"data": {
"phoneId": 123,
"envFileId": 123,
"taskId": 123
}
}Body
application/json
Phone ID,obtain through Get phone list api
Target directory for pushing files (default: /sdcard/Download for non-images, /sdcard/DCIM for images)
Upload Id for fragmented upload,The Upload Id obtained through the Initialize upload task
File name,File name,The file name of the uploaded file
File size,The total file size is supported
The path of the live file image is used for display
File upload type: 1-Regular file, 2-Live stream file(default: 1-Regular file )
List of file chunks to merge
Show child attributes
Show child attributes
Response
200 - application/json
⌘I
