lib/citygrid/api/advertising/image.rb in citygrid_api-0.0.10 vs lib/citygrid/api/advertising/image.rb in citygrid_api-0.0.11
- old
+ new
@@ -2,25 +2,24 @@
class CityGrid
class API
class Advertising
class Image < Advertising
- def self.upload user_id, name, type, image_path, options = {}
+ def self.upload name, type, image_path, options = {}
token = extract_auth_token options
image_data = Base64.encode64(File.open(image_path).read.to_s).gsub(/\n/, "")
format = options[:format] || image_path.split(".").last
request_and_handle :post,
"#{base_uri}/#{endpoint}/upload",
:body => {"mutateOperationListResource" => [
{
"operand" => {
- "imageType" => type,
- "imageName" => name,
- "imageFormat" => format,
- "image" => image_data
- },
- "operator" => "ADD",
- "userId" => user_id
+ "imageType" => type,
+ "imageName" => name,
+ "imageFormat" => format,
+ "image" => image_data
+ },
+ "operator" => "ADD"
}
]}.to_json,
:headers => merge_headers("authToken" => token)
end
end
\ No newline at end of file