2

I am going to use mailgun api.

Here is the cRUL command working in terminal properly.

curl -s --user 'api:key-...' \
    https://api.mailgun.net/v3/DomainName/messages \
    -F from='Excited User <mailgun@DomainName>' \
    -F to=me@outlook.com \
    -F subject='Hello' \
    -F text='Testing some Mailgun awesomness!'

I can't make sense how I can run this command using Postman.

I tried to import cURL command into Postman but it doesn't import api:key. I really can't understand how I can import this api key into Postman to run the api properly.

Please help me to run this command using Postman.

Thank you!

wagng
  • 691
  • 2
  • 11
  • 22

2 Answers2

2

For whoever wants to create the Postman request manually:

The --user (or -u) translates in Postman into Basic Auth Username and Password fields, which you find under the Authorization request nav option:

enter image description here

The -F (for form params) you add under Body request nav option, with x-www-form-urlencoded or form-data selected (if not sure which, check this question):

enter image description here

More on curl options here.

Voicu
  • 16,921
  • 10
  • 60
  • 69
0

Try importing it like this

curl https://api:key@api.mailgun.net/v3/DomainName/messages \
    -F from='Excited User <mailgun@DomainName>' \
    -F to=me@outlook.com \
    -F subject='Hello' \
    -F text='Testing some Mailgun awesomness!'
Pratik Mandrekar
  • 9,362
  • 4
  • 45
  • 65