-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Official FoxESS API Documentation #170
Comments
yeah, i have the same issue |
The old Fox API has been made private, you now have to use the new OpenAPI which you can find documented here https://www.foxesscloud.com/public/i18n/en/OpenApiDocument.html |
yeah, looks like i was on a wrong endpoint. do you know if there is any way to debug the signature creation? i get a this is my code require 'net/http'
require 'uri'
require 'digest/md5'
require 'json'
host = "https://www.foxesscloud.com"
token = "your-own-token"
timestamp = Time.now.to_i * 1000
lang = "en"
path = "/op/v0/plant/list"
puts signature = "#{path}\r\n#{token}\r\n#{timestamp}"
puts signature = Digest::MD5.hexdigest(signature.encode('UTF-8'))
uri = URI("#{host}#{path}")
req = Net::HTTP::Post.new(uri)
req['token'] = token
req['timestamp'] = timestamp
req['lang'] = lang
req['signature'] = signature
Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
response = http.request(req)
puts response.body
end maybe someone can give me a valid input output example so that i can verify the pieces |
i found the issue, the signature is literally using the carriage return, so it needs to be escaped such as require 'net/http'
require 'uri'
require 'digest/md5'
require 'json'
host = "https://www.foxesscloud.com"
token = "your-own-token"
timestamp = Time.now.to_i * 1000
lang = "en"
path = "/op/v0/plant/list"
puts signature = "#{path}\\r\\n#{token}\\r\\n#{timestamp}"
puts signature = Digest::MD5.hexdigest(signature.encode('UTF-8'))
uri = URI("#{host}#{path}")
req = Net::HTTP::Post.new(uri)
req['token'] = token
req['timestamp'] = timestamp
req['lang'] = lang
req['signature'] = signature
Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
response = http.request(req)
puts response.body
end |
Hello Everyone!
Does anyone have the latest Official FoxESS API Documentation?
I have already download one from this issue #74, but, when I call any resource with POST method I receive status 405 Not Allowed, if I call any resource with GET method I receive status 200 and HTML content, in the pdf says that the doc is updated at 02-2022, the API has changed? There is some way that I can get the latest version?
Thanks everybody.
The text was updated successfully, but these errors were encountered: