Skip to Content

This is one of the best the best apps to test the APIs, so thought of sharing about it.

To work with it, simply add this extension to your chrome browser. Visit – http://www.getpostman.com/ to add the extension.

This document discusses a sample scenario to test the Twitter Search API.

 

1. Create a new Test and select the Authorization tab. For Twitter we are using OAuth 1.0. So select the appropriate Authorization as per your need. Refer below –

Step1.png


2. Create an application on dev.twitter.com. Refer this link for more details.  We’ll require below details to populate them during authorization (the associated link mentioned above explains how to get it).

  • Consumer Key
  • Consumer Secret
  • Token
  • Token Secret

  

Step2.png


3. Testing API –

It’s up to you which functionality of Twitter you want to test. In my case I have tested the GET search/tweets functionality of the API. We’ll need the subsequent Resource URL and the parameters related to that API.

Twitter API – https://dev.twitter.com/rest/reference/get/search/tweets

Refer below screenshot:

Step3.png

Here you’ll get the necessary Resource URL which you need to pass in the URL section of the POSTMAN test case created by you.

Besides in the Parameter section pass the parameters for the API. In our case it is:

key = q and Value = BankofBaroda109 where q stands for query.

Refer below screen.

Step4.png

Once done. Click on Send to get the data from API. There you go.

Step5.png

There is also alternative way to test Twitter API – https://dev.twitter.com/rest/tools/console

      

This is a very basic test. But, you can explore more from your end to get the most of it.

     

Hope this document helps at the introductory level.


Regards – Santosh G.

To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

  1. Former Member

    Hi Santosh,

    First all, Thanks a lot for such a wonderful explanation.

    I am stuck in a “post” cal for .xsodata service (to create a record).

    First I made a get call to xsodata to fetch x-csrr-token.(PFB image)

    To create a record I make a “POST” request, with the environment variable i.e fetched token enabled (in header section) . Body Containing data to be created. PFB screenshot

    But, when I send the request , I get an error – 405 Method not allowed.(PFB image)

     

    Please help me understand how to pass the fetched token to a “POST” request.

    Do i need to make any changes in the URL or add params? I have tried all my ways but still no luck.

    I have also attached my .xsaccess and .xsodata file below.

     

    Thanks in advance for the help.

    Regards,

    Supriya Sahu

     

     

    (0) 

Leave a Reply