Apache Superset Rest API: How do I get chart screenshot - rest

I want to call following api to get screenshot of chart from superset.
/api/v1/chart/{pk}/screenshot/{digest}
But I don't know what should I input to {digest}.
Can someone please tell me what it is?

Use method /api/v1/chart/{pk}/cache_screenshot/ to get the key.
cache_key from response this method and there is digest

Related

Huawei push API throws error saying token count is wrong in postman

Using push API continuously returns token count should within 1 and 1,000. Please find the API error in the screenshot.
The possible causes of this problem is, you have placed the “token” attribute in wrong place.
Solution:
Please keep your “token” attribute within the “message” object,.
enter image description here
For details, check the following documents:
https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/android-server-dev-0000001050040110
Your token is outside the message body, "token", "android" should be within the message body.
Please check the sample code here
Also, if you want to use more tokens (>1000), the best method is to invoke the API using App server and send messages in batches.

Put method cant receive body data but work with direct URL pass parameter

i call api using postman ... api work fine with if i choose put method and pass a url like:
https://URL/user/123?id=123&name=foo
but if i using this link :
https://URL/user/123
And pass data in body put method not working.
I try to use form-data and x-www-form-urlencoder .. all not working .
Anyone know what is my problem ..
thank for your help.
and sorry for my bad English
Try to use RAW format with particular data-type/content-Type which your using in web service Eg: JSON(application/json) Hope this will solve your problem

Got error on invoking the IBM Softlayer "getCpuMetricImage" rest API

I have an active IBM Softlayer account. I am getting the error as
{"error":"One of types passed is not in the proper container.",
"code":"SoftLayer_Exception_Metric_Tracking_Object_InvalidDataType"}
when trying to fetch the cpu metric image using the below rest API with valid Virtual_Guest_Id and Snapshot_Range":
"api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/<Virtual_Guest_Id>/getCpuMetricImage/<Snapshot_Range>"
But I am getting the proper response while fetching the memory metric image using the similar rest API listed below:
"api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/<Virtual_Guest_Id>/getMemoryMetricImage/<Snapshot_Range>"
First of all your REST request is wrong it should something like this:
POST https://$USERNAME:$APIKEY#api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/$VSIID/getCpuMetricImage
PAYLOAD:
{
"parameters": ["day","9/2/2017"]
}
Second the method is not working currently I am going to report it, but I do not have idea when they are going to fix it.
Another thing to point out is that the Softlayer's control portal do not use that method to display the graph, so is likely that the image returned by the method and the graph in the portal are going to be different. If you want the same inforamtion I recomend you to use the same method see this forum for more information:
SoftLayer API CPU usage mismatch
The method in the forum above will return you the data of the graph and then you are going to need to represent that information in a graph using your own code.
Regards

Workfront API Unknown Object Type

I'm getting an error when trying to reference different object codes using the workfront API. When I try to do a https://company.attasksandbox.com/attask/api/arvpth/search
I get the following response:
{"error":{"class":"java.lang.IllegalArgumentException","message":"Unknown object type: arvpth in v2.0"}}
I know the object code exists because it's in the API Explorer. The only thing that's got me confused is that the error displays v2.0, if this means it's trying to use the API versioin 2.0 then, yes the object code did not exist in that version. So does anyone have an idea on why is it trying to use v2.0 instead of the current v4.0 of the API?
Thanks!
In order to use v4 of the API, you have to append api/v4.0/ to your link, ie, https://company.attasksandbox.com/attask/api/v4.0/arvpth/search
At least, that is what I had to do in my version of the environment. Hope this helps.

Unknown number of Parameters in GET request: Play Framework 2.3.x+ Twilio

I am trying to point my twilio voice URl to my server.
So my routes files has this line:
GET /v1/twilio/ controllers.Application.call()
When I get the request from Twili, I get it as below:
/v1/twilio/?AccountSid=someRandomSID&
ToZip=0000&
FromState=A&
Called=%2B109213098234&
FromCountry=US&
CallerCountry=US&
CalledZip=9000&
Direction=inbound&
FromCity=xyz&
CalledCountry=US&
CallerState=A&
CallSid=randomSID&
CalledState=A&
From=%2B123455667&
CallerZip=90909&
FromZip=9890&
CallStatus=ringing&
ToCity=BLA&
ToState=AA&
To=%2B765213765&
ToCountry=PQR&
CallerCity=PT&
ApiVersion=2010-04-01&
Caller=%23123213&
CalledCity=BB]
SO you see, there are a lot of parameters.
My problem is that I am Not aware of all the parameters.
So when I just put above line in my routes file, I get an Error: 404 Not found.
How should modify the routes file so that I get the GET request?
If I ask twilio to send me POST request, then I don't have to worry about it as then I can simply get the parameter I need by Querying thee RequestData.
But there has to be some way I can get GET REQUEST to succed and reach my application controller.
Please help me here.
sorry if this is a silly question. But I am really struggling to get some info.
PS: I am using 2.3X version of play framework
Also, I dont have the control over parameters sent by Twilio.
I will simply get a GET/POst request, as per this : https://www.twilio.com/docs/api/twiml/twilio_request#synchronous
There's nothing unusual with this route, it works with sample URL like a charm (checked) maybe Twilio untrails return path by default? try to add spare route for handling this case as well:
GET /v1/twilio controllers.Application.call()
GET /v1/twilio/ controllers.Application.call()