•   almost 6 years ago

API creation,documentation and all

hii i am DK, and i dont know how to create API like can we use another API in it like some Covid19 stats cracker and anything like that. anyone can you please explain me in detail thank you!

  • 6 comments

  •   •   almost 6 years ago

    Hi DK. There are two options. The most common option is to create a collection and set environment variables in the Pre-request script and the Tests script. Put each API call you want as a separate entry in the collection. I'd recommend going through the resources in the "Resources" tab, in particular watch the "Intro to postman" playlist, in particular video 4.

    If you are asking how your pre-request script or Tests script can make an API call, then I recommend reading https://learning.postman.com/docs/writing-scripts/script-references/postman-sandbox-api-reference/#scripting-with-request-and-response-data

    If you are asking how to have a Postman collection get invoked on demand, then check out https://community.postman.com/t/office-hours-january-12/18337 (the Americas video) where Joyce gets into details on Newman (about 7 mins, 30 seconds into the video).

    Hopefully this helps, if not, please explain more specifically what you are trying to accomplish and where you are stuck.

  •   •   almost 6 years ago

    Hello...im the post a man digital hack..im not sure what im doing is correct or.Please do me your favour to share any tips for me to get a podium seat..thanks ans have a nice day...stay safe , stay at home

  •   •   almost 6 years ago

    i mean how we can create APIs and use it ?? and can we use someone's API and modified according to our need and use it later ?? and how we are going to use this collections,APIs, workspaces?? can we use this API in android studio? i m from android background and i have no knowledge of how this postman api hack works. please tell me thank you

  •   •   almost 6 years ago

    Sadly, I've never had the time to look at Android yet, so I'm not sure I can completely answer your question. I've been more focused on the Arduino and Microsoft Azure Sphere space for IoT devices.

    I think you are saying... "I created a collection in Postman. My collection takes input variables, makes a few API calls with them, and then outputs something helpful. I'd like to run my collection as if it was an API and get the results, so I can use it in my application."

    If your environment supports NodeJS >v10 then Newman is the best solution. Your program would invoke Newman passing it the collection and environment (and maybe customize the environment with variables you care about).
    https://github.com/postmanlabs/newman#using-newman-with-the-postman-api

    I ran into something similar trying to integrate a Twillio webhook and was thinking about using Express to expose Newman as an HTTPS API. I've never used Express before, but I think it should be fairly straightforward. I feel that would be a useful project, and searching around the web I didn't find anyone else doing that. I probably won't get to that hack until Friday or so and don't expect to be done with it until Sunday. Once I'm done I'll publish it on github.com and update this thread as well.

    The rules clearly say "Entrants must create a public Postman workspace that is useful, has business value, and engages the community. Projects must have at least one (1) collection."
    Your entry and the judging is focused on the public workspace, so I'm not sure that building the app around your workspace will count toward the contest. Likewise I don't believe my webhook will count toward this hack, but I think it's generally helpful for the community so I'm gonna do it anyway.

    My take on this hackathon (which could be wrong) is that we should focus our energy on making our public workspace awesome and something that people will end up bookmarking and using.

  •   •   almost 6 years ago

    exactly thank you bro. I think we have to collect data from various sources and then we can create API then collections right? but i dont know how other developer gonna use my workspace.it will be just collections so how ??

  •   •   almost 6 years ago

    Hi DK, hopefully your hack is going well. https://community.postman.com/t/cloud-newman-me-run-your-collection-as-an-api/19496 is a link to CloudNewman.me which enables people to treat your collection as if it was an API. I just finished hacking on it, so it might have bugs you could encounter so I wouldn't recommend taking a dependency on it for your hack; but I'd love your feedback later.

Comments are closed.