Hi everyone, I am not so familiar with API and i'm integrating payment gateway "Omise" in my web site using their API. The problem is when i use their API "https://api.omise.co/charges" and send the values like this       "https://api.omise.co/charges?{key}:&amount={Amount}¤cy=sgd&card={Token}".

Then i get the 401 Unauthorized error. In their website they show sample on how to send values.

I don't know how to send these values in api link. Here is my full screen shot.

Any suggestion? 


With regards.

Hope you are passing the key and token for this correctly. Those would be used for authorization I guess. 

Tushar Panpaliya wrote:

Hope you are passing the key and token for this correctly. Those would be used for authorization I guess. 

Yes, i have valid key and token but i'm not sure passing format is correct or not.


Phone wrote:

Tushar Panpaliya wrote:

Hope you are passing the key and token for this correctly. Those would be used for authorization I guess. 

Yes, i have valid key and token but i'm not sure passing format is correct or not.


did you try using the test option to try different combinations ? additionally you can try something like postman to test API calls.





Hi,

Simulate the above CURL into Postman request & then you can easily identify how to prepare the request.

  1. Open POSTMAN
  2. Click on "import" tab on the upper left side.
  3. Select the Raw Text option and paste your cURL command.
  4. Hit import and you will have the command in your Postman builder!
  5. Click Send to post the command

Ref: https://stackoverflow.com/questions/27957943/simulate-a-specific-curl-in-postman

Hope it helps,

Assif

assif_tiger wrote:




Hi,

Simulate the above CURL into Postman request & then you can easily identify how to prepare the request.

  1. Open POSTMAN
  2. Click on "import" tab on the upper left side.
  3. Select the Raw Text option and paste your cURL command.
  4. Hit import and you will have the command in your Postman builder!
  5. Click Send to post the command

Ref: https://stackoverflow.com/questions/27957943/simulate-a-specific-curl-in-postman

Hope it helps,

Assif

Hi assif_tiger, what should i put in username and password?

Thank you,