This method creates and returns a file upload url for a user's profile image. Creates and returns a URL and fileKey for uploading a profile image. Files are stored on Google's Cloud Storage Platform. For more information, see the File System Guide.

URL Parameters

None.

Body Parameters

NameDescriptionJSON typeRequiredDefault Value
filesAn array of fileData objects. Each fileData object represents a different fileArray of ObjectsYes
Content-TypeMIME type of file to uploadStringNo
Content-LengthThe size of the file being uploaded, in bytesNumberNo
dimensionThe display dimension of the image.String "original" or numberNo

Authentication

JwtAuthenticator, Oauth2Authenticator, AnonymousAuthenticator

Authorization

OAuthAuthorizer

Example Request

URL

POST https://spacesapis.zang.io/files/getprofileimageuploadurl

Headers

Authorization: "jwt eyJhbGciOiJSUzI1NiIsIdfgdfgnR5cCI6IkpXVCJ9.eyJ1c2VyX2lkX3NpZyI6ImxPWHpxNzVzR3J3X0xwWEMyRGRMakhyYXJlWVhyTzFMdEZHZkhkOWNkTXciLCJwcm9kdWN0X3R5cGUiOiJhY2NvdW50cyIsImxhc3R1cGRhdGV0aW1lIjoiMjAxNy0wMS0zMFQxMzo1ODo0Ny4yMDYiLCJpc3MiOiJ6YW5nLmlvIiwicHVibGlja2V5aWQiOiJhZ3h6Zm05dVpYTnVZVEl3TVRSeUdnc1NEVWRLZDNSUWRXSnNhV05MWlhrdfgdWdJQ2dsUEtFakFvTSIsImV4cCI6MTQ5NTM5MTIwMywidXNlcl9pZCI6ImFneHpmbTl1WlhOdVlUSXdNVFJ5RVFzU0JGVnpaWElZZ0lEQXMtX25fUW9NIiwidmVyIjoiMi4wIn0.SqZpw1uPIebqW3qlDsm0-DWYFKEH0SgPwtD-tSESWOF-5hLkZMqJH28ooWux2S7s9riIew7pTVPnZpTgJa5zHcEAG0gXSEJVOqmpGp_4ufM8YtZoZMpBFjyAkwyAt-ILkGUYIo0GU5WyzMPLV8YLXfgdfgOgkE2MGGOajBkjPmC2Db3pA0D0M9k-21EL1gwWBC5YIq0PDAkgulegwl6khRmB8irJQ-dfg-d-KV9eYfFpsCdJKRGzSfqg"

Or

Authorization: "bearer f746696f5de4528u128ae2f274eea253e8a7943a"

Body

{
  "files":[
    {"Content-Type":"image/png","dimension":"original","responseDisposition":"1234567890"},
    {"Content-Type":"image/png","dimension":160}
  ]
}

Example Response

{
  "data": [
    {
      "fileKey": "pictures/pfpic_user_287f310f-aba5-4879-a18e-247c07c4894a",
      "url": "https://storage.googleapis.com/onesnatesting/pictures%2Fpfpic_user_287f310f-aba5-4879-a18e-247c07c4894a?GoogleAccessId=logan-testing@onesnatesting.iam.gserviceaccount.com&Expires=1493149882&Signature=fJd96uP6Wk9wCug4LUIvjEuJrrD3hZCYnSCeqsdLvm0NHQDBlX8t%2BYL%2FoQhDvaUyAi8Fw5je8iUFQ%2Bu8xqoavpwbofk6WuPn78VPPmduDu6oY6ZNQTVKHkIbShTV0bjiQXH2bKyPDgeXeRyQueO6X%2BOaIMBEP5fL7cwR5rfyoPjFFmD%2Bzy4KOvP2rAMC2K%2FCJaDMN3x6nhZ1gaqeQN4P5e4fL0kNkqCHYSshse47QPCUM%2FHD2uFxKfyezSTv95tcNndHarhUwdkcX6RG8al6qz2UaKbGzhUj1PPKkmkr%2BvwC3MGJ17sewDlYnyEhZPSmMW0yWyGesVg5XYE6zkDmjQ%3D%3D&response-content-disposition=1234567890"
    },
    {
      "fileKey": "pictures/pfpic_user_4ca9eec2-31b8-41d0-a8f2-25021fb0b562/160_160",
      "url": "https://storage.googleapis.com/onesnatesting/pictures%2Fpfpic_user_4ca9eec2-31b8-41d0-a8f2-25021fb0b562%2F160_160?GoogleAccessId=logan-testing@onesnatesting.iam.gserviceaccount.com&Expires=1493149882&Signature=pGelG6OzAZgQ6ykNFWsOHMr%2BJBVXz1BCCR3NwgVIuezeR2dSHPrheskWvz0AiQie0nbRO%2FpKt9pr0HvYZGtEDDREGZTXpyw%2FkOzY3CVYj8gvDtiuSt%2BErTkNpsruNJvqzu7zo%2BqbGljs8Y0k6ppG15UKt7JC3mAAnhBjmw%2BsvmWdEHaJMqK1GbZzYIYwbOpRytftWMwidegW%2FSOxoaFXrADEeOD2yhqRHj2FnNicZRRPnVElI72O53GXqYDEpNrX3zMbaTEPPoVFcRCqy4v322TW%2BCng8ftdvMantUL4dxG2qUUrwApC1ldEye1hi%2BI5xUwWBevIuEMamkyhqcGXvA%3D%3D"
    }
  ]
}