Now i am using postman Version 7.34.0.
I imported swagger 2.0 api and create collection, create mock server and mock example data for the api request.
Everything works well.
But when i found that our api changes, i update the API in the postman. But there is no way to update collection.
I checked this Webinar tutorial at time of 25:35, adding the parameters in the header, then it demo how to update to collection.
But for my case, i tested with our swagger api changes or create a new yaml of openapi 3.0 api, made the changes in query param or add/remove the request. But there is nowhere I can update collection.
I only saw to 'Generate Collection' button, i don't want to generate a new collection, because there can be lots of api I already added the example response data, so I don't want to generate new collection for the api changes, I just want to update the existing collection and later i can manually modify the example response data.
But now I can only manually change the collection for the api changes, not very convenient to use. I also see the posting api to get and update collection with body. But it is more difficult to use.
Is there any button click to update collection anywhere else?
Thanks a lot.
Related
I'm creating a website for a local establishment that uses Ifood. Ifood provides an API that allows you to check information, both regarding establishments and incoming orders.
The code is ready, but I can only show a new order update when manually refreshing the page. Which is a bit shippable. I thought about putting an automatic update with JavaScript at the given time, but it would be an ugly workaround.
In this case, I'm getting JSON data, but in a more general context.
How could I refresh the page as soon as new data appears?
An automatic update with Javascript might not be as dirty as you think. Even smartphone push notifications are really just occasionally polling under the hood.
If you really want to push from your server, WebSockets or server-side events are what you want. Unfortunately, it seems this kind of setup is not natively supported by Django.
Another option could be to use a paid service like Pusher.com. Such services usually let you listen for an even in JS, then call an API endpoint to trigger it from your server. This will work well on Django or any other server setup.
I'm trying to setup a Documentation for my API specification in Postman. My problem right now is that if I modify something on the Open API screen, my documentation does not get updated.
Right now the only way to update it is to delete it and create it again. Any idea how to auto refresh it without doing that? (if it's possible)
I have added this screenshot to help understand what exactly I am using:
You don't have to delete the collection every time, you can update previously generated API elements (such as Documentation, Tests etc) through the UI:
Open the Documentation tab
Click Validate against Definition at the top-right
Click Issues Found and access the Issue summary
Select the changes and Apply
The documentation for that can be found here: https://learning.postman.com/docs/designing-and-developing-your-api/validating-elements-against-schema/#updating-api-elements
And here's a video showing you how to do it: https://youtu.be/BUZiRtGRHj0?t=340
At the moment it is not possible to trigger an update automatically whenever the schema is changed, but you could use the Postman API to pull changes on a regular basis using the Sync relation with schema endpoint:
https://www.postman.com/postman/workspace/postman-public-workspace/documentation/12959542-c8142d51-e97c-46b6-bd77-52bb66712c9a
I'm using django and trying to integrate it with quickbooks online through python-quickbooks package and already did so and it works fine, but the problem is I don't want to store the tokens in the request session because I'm trying to access them outside the views, to be exact I'm trying to send an invoice each time an invoice(invoice model from django) object was made I want to send one to quickbooks and I'm doing this through django signals but I can't access the session from the signals so where is the best place to store them on the server side?
thanks in advance.
You can create new Django model just for your integration and query it when you need to get tokens. Especially it can be useful if you plan to have multiple integrations, you can add relation from object (which is related to signal) to "integration object".
I am interested to add my service into the share functionality of the Google Glass, my flow is below:
1. Take photo / Record video
2. Share with -> My service
3. the photo or video should be uploaded to my site
Is this functionality possible? it is very similar to Facebook and G+ share options.
I will be happy to know how to do it, Thanks.
What you are looking for is what the Mirror API calls a Contact. Your Glassware can setup one or more Contacts, specifying what content type can be shared with you and/or if there are voice commands which will trigger the Contact.
You will also need to setup a Subscription which will be the public URL for an HTTPS enabled server that the Mirror API will use to send you the content that was shared with the Contact.
In general, the flow when a user first authorizes you to write to their time would be something like this:
Add a Subscription, so you can get callbacks.
Add one or more Contacts. In your example, you would want to register the Contacts to have acceptTypes of image/* and video/*, although you can also omit the acceptTypes to get everything (including text).
The callback you register with the subscription should be able to handle a JSON body, and should return HTTP code 200 as quickly as possible. A good procedure is to actually accept the body, place it on a job queue for processing later, and immediately return the 200 code. When processing the body, you may want to do something like
Confirm the userToken and verifyToken provided are valid.
Using the itemId, get the Timeline item, which will include attachment information about what was shared with you.
If the attachment is marked as isProcessingContent, then the content isn't ready for you and you should return the job to the queue and try again soon.
If isProcessingContent is false, you can use the attachment URL with the authentication token for the user to fetch the content itself.
There are a lot of details I've glossed over here. For a further overview of the flow, see https://developers.google.com/glass/develop/mirror/contacts
I randomly pick two friends of the user and ask him/her to pick who is the better friend. Now all I have is the friend ID which I then have to use to create a poll and store in the database accordingly. Using the Facebook graph API, I have the ID. All I need to do now is to pass it to Django.
I'm new to this so how exactly would I do that? Pass a javascript variable to Django?
I see two options.
At client side using Javascript SDK,
Fetch the friends' profile details along with ID.
Convert them to JSON.
Do a POST request to a django url/view which stores the data in database.
In this way, you don't need to do any graph API queries further from server side. But this won't help you updating the data at realtime. Consider, if one of the friends changing his name in FB, now what is stored in your database becomes obsolete. So, you need to make sure that some thing from client side implemented to do real time update posts to server side.
At server side using any django facebook graph API apps,
Get the IDs from client side.
Use the fb graph app to fetch the details at server side.
Store them in database.
In this way, you could be able to schedule a callback for real time updates. I prefer the second approach as it's always better to burden the server rather than client. And I found this app simple and do what you need. https://pypi.python.org/pypi/django-facebook-api/0.1.10