I am developing a c# application to upload videos to Vimeo throough the Vimeo API. Everything's gone fine so far, but I cannot find a way to check the progress of video uploading to Vimeo when using automatic pull uploads. I don't want percentage values (which we can derive in regular uploads), but just a success or failure response would suffice. Is there any way I can do this through an API call?
The response of your inital POST request to /me/videos is the full clip representation. On that representation is a status field, that will contain one of the following values:
uploading
transcoding
uploading_error
transcoding_error
available
quota_exceeded
The uri of that representation is an API endpoint that you can store, and call again in the future to receive an updated status.
eg:
POST https://api.vimeo.com/me/videos
type=streaming&link=http://example.com/my/video/mp4
{
"uri": "/videos/12345",
.....truncated.....
"status": "uploading"
}
[some time later]
GET https://api.vimeo.com/videos/12345
{
"uri": "/videos/12345",
.....truncated.....
"status": "available"
}
Related
I want to retrieve data regarding insights of my Facebook posts. I am able to retrieve all this information under graph API explorer but keep on getting errors the moment I put it into a graph URL.
Here is the URL :
https://graph.facebook.com/v15.0/{page_id}/posts?fields=insights.metric(post_engaged_users,page_posts_impressions_unique)&token_access=ACCESS_TOKEN
(I removed the page_id and ACCESS_TOKEN for privacy.)
I end up getting this error:
{
"error": {
"message": "(#200) Provide valid app ID",
"type": "OAuthException",
"code": 200,
"fbtrace_id": "AuaCwwoNGZW_U4Ivay4Xi1f"
}
}
Can someone guide me on what to do in this case? I guess I have to include my app_ID into the Graph API URL, but where exactly?
Thank you.
I searched for a solution from the Facebook developer community but could not get any solutions.
Bottom line is that I'm trying to download my order history data from Lowes.com. I'm assuming there's an API endpoint that can be used but I haven't figured out the method or maybe what parameters need passed to get a successful request.
I looked at using python and scrapy but I don't believe the format of the webpages are going to be easy to parse the data.
I have found references to APIs in some of the javascript code for the website and the mobile app. Some of the relevant urls I've found:
From website -
ORDER_HISTORY_USER: '/wcs/resources/store/%0/member/%1/orderhistory/v1_0' (from function named Conduit on www.lowescdn.com)
From mobile app:
"url": "https://lwssvcs.lowes.com/IntegrationServices/resources/mylowes/user/order/list/v1_0"
"url": "https://lwssvcs.lowes.com/IntegrationServices/resources/mylowes/user/order/instore/v1_0"
So far I've only attempted to use these links via a browser after logging into my account. Assuming I'm on the right path, what method should I use to successfully get the data?
Within a web client using the Forge API, I would like to get a JSON array of Revit elements in a model. Using the Design Automation API, I am creating an Activity that uses FilteredElementCollector to retrieve the elements, but once I have the elements I'm not sure the best way to retrieve those results in my web service. This Activity does not need to write back to an .rvt file.
The CountItApp tutorial writes the results to a results.txt file in cloud storage, and the web app then downloads that results.txt file and parses the results. On my web client I want to display these results, but file I/O does not seem like a very good solution for JSON data. A couple alternatives I've considered:
Write results to an external database and query that database in my web application once the WorkItem completes. As far as I know this is not possible due to Forge's restrictions on network access within an Activity.
Pass the results with the onComplete callback. I don't know if this is possible.
Design automation allows you to post a workitem with output arguments with POST callback. This allows you to receive the output data as application/json if your output file generated by your activity is a json file.
Design automation also allows you to specify a variable workitem.id in your output url. When your workitem completes we shall call this url with the variable expanded to the id of that workitem. This dynamic variable path allows you to determine the workitem id associated with that callback.
Here is how you could go about. First define an activity with such an output parameter (verb: post) with a hardcoded local name result.json:
"results": {
"zip": false,
"ondemand": false,
"verb": "post",
"description": "Results",
"required": true,
"localName": "results.json"
}
In your appbundle code save the json contents in a file with hardcoded name result.json to the current working folder.
using (StreamWriter sw = File.CreateText("result.json"))
{
sw.WriteLine(JsonConvert.SerializeObject(data, Formatting.Indented));
sw.Close();
}
Then you can post a workitem like so:
"result": {
"verb": "post",
"url": "https://www.yourserver.com/results/$(workitem.id)"
}
In your server implementation of the callback you will get the json contents as the payload. You may read the results and communicate back to the client corresponding to the workitem id, using sockets or any other means of communication you may have with your client.
I'm making the following request against the Microsoft Live API:
GET https://apis.live.net/v5.0/me/picture?access_token=ACCESS_TOKEN
The result, unlike any other request to that API, is a redirect to a physical image location, which causes the actual image object to be returned instead of a typical JSON response that would include the path to that image.
I could dig into the the response object and try to get the Content-Location header or something to get the URL I'm looking for, but that feels very brittle and diverges from the way I'm handling every other API response.
I also know that the API URL itself, based on this behavior, can act as the image URL, but 1) I'm using a client that constructs that URL behind the scenes and 2) I don't want to persist the access token in something like a profile picture column.
The Interactive Live SDK actually shows a JSON object as the return for a REST request:
{
"location": "https://cid-0000000000000000.users.storage.live.com/users/0x0000000000000000/myprofile/expressionprofile/profilephoto:UserTileStatic"
}
That is the kind of response I want, and since the interactive SDK can show it, there's got to be some way to request that JSON be returned. I've tried setting redirect=false in the query string (necessary for Facebook, which does something similar) and setting the Accept request header to application/json. Neither had any effect.
This is not truly an answer to my question, so I'd still be interested any responses along the lines of my original question. However, I have found a workaround of sorts.
The URL https://apis.live.net/v5.0/{user_id}/picture will return the appropriate photo photo without requiring an access token. Therefore, all you need is the the user's id to construct this URL, and that can be obtained via:
GET apis.live.net/v5.0/me?access_token=ACCESS_TOKEN
Which will return something akin to:
{
"id": "0000000000000000",
"name": "John Doe",
"first_name": "John",
"last_name": "Doe",
"gender": null,
"locale": "en_US"
}
The id member there, is what you need for the URL. It's not ideal, because I have to sort of do two steps, and hope Microsoft doesn't change the way the profile picture for a specific user is retrieved or suddenly starts requiring an access token for that too. It's better than nothing, though, I suppose.
Adding ?suppress_redirects=true should do it.
i.e.
GET https://apis.live.net/v5.0/me/picture?access_token=ACCESS_TOKEN&suppress_redirects=true
I actually haven't tested this with /me/picture, but {user_id}/picture has the same behavior and adding suppress_redirects=true did the trick.
Is anyone aware of method of accessing Google AppEngine Cloud Enpoints using ActionScript 3 without having to go through the JavaScript layer? I have been going on the docs and Google to find any tutorials or examples but did not find anything useful.
We don't have AS3 client libraries and currently there are none planned that I know of, so you'll have to rely on HTTP to make your REST calls.
TLDR; Use the APIs Explorer
If you visit
https://your-app-id.appspot.com/_ah/api/explorer
(replacing your-app-id with your actual application ID), then you'll be redirected to your own custom version of the Google APIs Explorer.
In it you can click on individual APIs and see the list of all available methods. Within a the page for each method, you can try out forming requests and the Explorer will suggest the correct values to use.
After you click "Execute", the full HTTP request (headers and all) and response will be printed on your page, which will show you which commands to use.
Description of how to use the Discovery Document
The Discovery Document for your API will contain all the information you need to construct a request.
To find the root for calling your API, check out the baseUrl key. It should be something like:
https://your-app-id.appspot.com/_ah/api/tictactoe/v1/
To figure out how to call a specific method, there are descriptions of every method, nested down as resources in the Discovery Document. For example, for the Tic Tac Toe Python sample, the board_get_move method has a name of board.getmove in the #endpoints.api decorator. This means the method getmove is owned by the resource board.
If you look in the resources.board.methods key in the Discovery Document you can see the getmove method:
"getmove": {
"id": "tictactoe.board.getmove",
"path": "board",
"httpMethod": "POST",
"description": "Exposes...",
"request": {
"$ref": "TictactoeApiMessagesBoardMessage"
},
"response": {
"$ref": "TictactoeApiMessagesBoardMessage"
}
}
Combining the path with our baseUrl we know requests will need to be sent to
https://your-app-id.appspot.com/_ah/api/tictactoe/v1/board
and from httpMethod we know requests will use the HTTP method POST.
Finally, to specify the request, we see a reference to a schema:
"$ref": "TictactoeApiMessagesBoardMessage"
Looking in the schemas.TictactoeApiMessagesBoardMessage key in the Discovery Document we see:
"TictactoeApiMessagesBoardMessage": {
"id": "TictactoeApiMessagesBoardMessage",
"type": "object",
"description": "ProtoRPC message definition to represent a board.",
"properties": {
"state": {
"type": "string"
}
}
}
so we know the payload must contain a single field called state and that field must be a string.