1

I need to hit this endpoint as part of an assessment, I have tried having a looking online and I would ideally like to do this just by using the browser console.

This is my task:

Your task is to write some code (eg. console, html form, javascript, python etc.) to hit 2 API endpoints. You can use any language, framework, tool or library. The result of each endpoint will give you instructions on how to proceed. The first endpoint is /api/Step1 and requires a GET verb and a parameter value=40

I am really trying to understand how to do this but all of the things I have read have not worked.

Any help would be greatly appreciated.

[Postman]

https://i.stack.imgur.com/DA5Oq.png

Muhammad Ali
  • 119
  • 3
  • 13

2 Answers2

2

You should make sure you get the idea of what an API is, and you can read this for the queries.

That said, you are looking to send a GET http request to the url /api/Step1?value=40. You can to this using a tool like Postman on Chrome, but there are other equivalents for other browsers.

If you are using osx/linux, you can look up the command curl on google to see how to do a GET request from the terminal, or check this SO question.

Community
  • 1
  • 1
John K
  • 1,285
  • 6
  • 18
  • I had added a screenshot to the original post, if you could take a look i would appreciate this. I am not sure what I am doing wrong. - thanks for your post btw it was a helpful read on apis – Muhammad Ali Feb 11 '16 at 17:01
  • You simply need to add the global path to the api. The full path could look somewhat like `http://www.example.com/api/Step1?value=40.` – John K Feb 11 '16 at 17:11
  • I figured it out :D, thanks for that help. I am at the last stage which is : "Congratulations Step 1 is complete. The second endpoint is /api/Step2 and requires a GET verb and a parameters: code=EC1R0NE, name=, and email=" I tried this : http://cogworksdevtest.azurewebsites.net/api/Step2?code=EC1R0NE+name=muhammad+email=example@gmail.com but it didnt work. – Muhammad Ali Feb 11 '16 at 17:17
  • I put Step1 instead of Step2 ;D - fixed now – Muhammad Ali Feb 11 '16 at 17:35
0

Sending a GET request is quite easy. You can use curl and php for example. If you google it, you can find examples. Giving a parameter is easy like this: /api/Step1?value=40