camera.uploadFile

앱은 카메라에 이 명령어를 실행하여 카메라에서 서버로 직접 이미지 또는 동영상을 업로드합니다. 카메라는 포함된 매개변수를 사용하여 HTTP POST 요청을 작성해야 합니다. 업로드할 파일은 fileUrl에 의해 지정되며 accessToken로 지정된 올바른 승인과 함께 uploadUrl에 업로드해야 합니다. 이 명령어는 API 수준 2.1에 추가되었으며 직접 업로드와 관련이 있습니다.

컴퓨터 명령줄에서 다음과 같이 할 수 있습니다.

curl -X post -H "Authorization: Bearer accessToken" -T fileUrl uploadUrl

매개변수

  • fileUrl: 서버에 업로드할 파일의 URL입니다.
  • uploadUrl: 파일 업로드 위치를 나타내는 문자열입니다.
  • accessToken: 업로드에 대한 인증 정보를 포함하는 토큰입니다. 앱에서 가져와 카메라로 전송합니다.

결과

  • 이 명령어는 결과를 반환하지 않습니다.

오류

  • missingParameter: 일부 매개변수(예: fileUrl)가 누락되었습니다.
  • invalidParameterName: 하나 이상의 입력 매개변수 이름을 인식할 수 없습니다.
  • invalidParameterValue: 입력 매개변수 이름이 인식되지만 전달된 값 중 하나 이상이 잘못되었습니다. 예를 들어 fileUrl으로 지정된 파일은 존재하지 않습니다.
  • uploadError: 카메라를 업로드할 수 없습니다.
명령어 I/O
명령어 입력
{
"parameters": {
"fileUrl": "URL of the file.",
"uploadUrl": "A string representing where to upload the file.",
"accessToken": "A token containing the authentication information."
}
}
명령어 결과
none
명령어 출력 (오류)
{
"error": {
"code": "uploadError",
"message": "Camera failed to upload the file."
}
}