Getting error while making mSuperdrive and mBeam API Calls in Postman Collection - edgeengine

I am working on mimik Smart-car-use-case Postman Simulation. As in [C2] → mSuperdrive mimik add a media Obj locally (Car 1), I have added an image locally on Car 1, and Check the mimiked file by calling [C3]
and then I made [C4] → mbeam NODE1 GET play_queue api call and got the list of files in mBeam play_queue as below.
After that I deleted the image which I have added in [C2] Api Call,
and again I hit Send on [C3] , I am getting the following error,
Since the image is in mBeam play_queue why am I getting error, when i delete the actual image?

Regardless of the image being added to play_queue, the physical file still needs to reside in origin. The reason you are getting 404 is because the the actual file is gone due to your deletion.

Related

(Asana) XML is invalid: Headers are not supported on this surface

I am pretty sure I am using exactly the same code in the following two cases, as I tested it on Postman first.
The first time I tried to create a task from Postman, it has no issue.
The next time I tried to do the same from my NodeJS server, and it shows this error. I tried the client SDK package and manually calling through Axios, both are not working and throwing the same error.
Is the Asana API not callable from NodeJS server?
It turns out the "Headers" does not indicate the Headers sent with the request, but the "Headers" HTML Element inside the rich text field. Ensure there's no h1-h6 element in your html_notes can solve this issue.

python MSAL patch request "The OData request is not supported" marking message as read

my application has Mail.Read.Write permission for MS graph API and the application has restrict policy on exchange online . The restriction is for a security group and the mailbox folder i am trying to access is a member of that security group. get and post methods are working fine only problem is with patch . I need to mark some emails as read after processing them.
r2 = requests.patch(request_url2,
data=json.dumps(request_body2),
headers={'Content-Type': 'application/json','Authorization': 'Bearer ' + result['access_token']})
pastebin_url2 = r2.text
print("The pastebin URL is:%s"%pastebin_url2)
the same API works fine from graph explorer has anyone tried using python msal and requests...any help appreciated
Looks like the message Id changes after moving message to a different folder
so i changed my code to first mark the message as Read in Inbox and then move to a another folder instead of the other way around. I tried with ImmutableId but it also changes after moving message to different folder.

Unable to simulate Smart-car-use-case - mimik

I have been trying to solve the Smart-car-use-case. I took Car 1 as RaspberryPi and Car 2 as Laptop(Windows). I have an image of obstacle in Pi which is used as the dummy data.
As per the assumption any image on the local machine (here Pi board) can be taken as the dummy data.
And as in the step "[C2] → mSuperdrive mimik add a media Obj locally (Car 1)", I have to use the image file path (ex:home/pi/Desktop/image.jpg) as the url, so the postman should be running in Pi board.
But postman is not supported with RaspberryPi
then how can I simulate this problem.
On the laptop (Car2) if you have postman go to the [C2] → mSuperdrive mimik add a media Obj locally (Car 1) call and open it in a postman tab. On the right-hand side there is a "Code snippet" tab. Open this tab and set the code you want to see to "cURL" this will convert the [C2] → mSuperdrive mimik add a media Obj locally (Car 1) API call into a cURL command. Copy all the code in code snippet and move it to the PI. On the PI you will need to install cURL. Once cURL is installed paste the code snippet into terminal to simulate the call. Please make sure you use the right tokens and set the right paths before pasting the command into terminal.

Not able to make mSuperdrive and mBeam API Calls in the Postman Collection

I am trying to make mSuperdrive and mBeam API Calls as in the Smart-car-use case ( [ Group C – Car 1] in the postman Collection). When I made the [C1] → mSuperdrive LOCAL DISCOVERY api call (to see the Link Local clustering) I can find both of my devices in the response object,
but along with the response I am getting the following error.
This is an error coming from postman's "Tests" tab, we have put some code in there to extract data from response body in order to set environment variables. If you are getting a 200 OK response with your devices showing you can simply ignore this error. You can also comment out the code in "Test" tab and you will not see the error for that call again. Please periodically check here for new updates to the collection that will fix these issues in the future.

php library for flickr API

I am banging my head trying to use Flickr API...
My goal is to be able to upload images and create albums in my Flickr account from my website...
I tried the phpFlickr library but apparently it needs updates for getting authenticated tokens...It keeps giving me "Invalid auth token".
I did some reading on how to get tokens and using DPZFlickr managed to get oauth_token & oauth_verifier but failed to exchange that with an access token...It also failed in uploading any photo to my account using the included upload.php example (Giving me an "empty" error!).
After digging in DBZ flickr.php code, I managed to get this error when trying to upload to Flickr: "oauth_problem=signature_invalid&"
So I began to search how to create a valid signature to eventually get a valid access token...and concluded that it is quite some work to be done here if I am going to build everything from scratch.
So my question is: Are there any updated php libraries that I can use to successfully create albums and upload photos to my Flickr account? Or should I go ahead and try building one?
OK..I finally got it to work with the DPZ library.
For future reference anybody facing the same problem as I had:
I managed to create an album using DPZFlickr by changing the method in auth.php to flickr.photosets.create....which indicated that the library correctly generates an access token with write permission..
However, the upload example kept giving me the "Invalid signature" error....
I checked the code. Flickr.php correctly unsets the photo parameter before signing the request then adds it back and submits the request which is exactly as indicated in: www.flickr.com/services/api/upload.api.html
I found a discussion in https://www.flickr.com/groups/51035612836#N01/discuss/72157650261711318/ that cleared out that the error was not actually a signature problem, but rather the 'photo' parameter that is being sent is the problem. It's just that Flickr doesn't know what to do with the photo parameter so it sends the signature error.
So what' wrong with the photo parameter?
Flickr API requires that the image has to be sent in binary form...The DBZ library, Flickr.php script line 677, does the hard work for us using the cURL function in php (http://au.php.net/manual/en/function.curl-setopt.php).
It sends the $parameters (which includes the uploaded photo) to the post field of the http request which should do the upload in binary format for us.
However, a brilliant comment I found in CURL PHP send image
states that:
"CURLOPT_SAFE_UPLOAD defaulted to true in 5.6.0... so you will need to add curl_setopt($ch, CURLOPT_SAFE_UPLOAD, false); before setting CURLOPT_POSTFIELDS"
Checking the manual: http://au.php.net/manual/en/function.curl-setopt.php
it says:
"Added in PHP 5.5.0 with FALSE as the default value. PHP 5.6.0 changes the default value to TRUE."
So if your php version is 5.5.0 the library will work just fine whilst if using version PHP 5.6.0 you need to add a line before 677 in Flickr.php to change the CURLOPT_SAFE_UPLOAD to false (that's why the library works with some and others not).
To solve the issue...Just add this line before line 677 in Flickr.php:
curl_setopt($curl, CURLOPT_SAFE_UPLOAD, false);
That's it. (-:

Resources