#Ruby #get the schema file = HTTParty.get("https://ocl.xcommercecloud.com/marketplace/profile/delete/1.0.0") schema = Avro::Schema.parse(file.parsed_response.to_s.gsub(/\=\>/,':')) #construct a test message message = "{\"xProfileID\": \"123\"}" #define a topic topic = "marketplace/profile/delete" #parse the schema and encode the message stringwriter = StringIO.new datumwriter = Avro::IO::DatumWriter.new(schema) encoder = Avro::IO::BinaryEncoder.new(stringwriter) datumwriter.write(JSON.parse(message),encoder) #post to fabric http_action = HTTParty.post("http://api.sandbox.x.com/fabric/#{topic}", {:body => stringwriter.string, :headers => {'Content-Type' => 'avro/binary', 'Authorization' => 'Bearer QUkAAV4C7dkO5NH/c1IGdFeZeaqMbeiZe1yoGp...', 'X-XC-SCHEMA-VERSION' => "1.0.0"}})