meta {
  name: Send Bulk SMS
  type: http
  seq: 1
}

get {
  url: https://api.textlocal.in/send/:id
  body: json
  auth: bearer
}

params:query {
  apiKey: secret
  numbers: 998877665
  ~message: hello
}

params:path {
  id: 123
}

headers {
  content-type: application/json
  Authorization: Bearer 123
  ~transaction-id: {{transactionId}}
}

auth:awsv4 {
  accessKeyId: A12345678
  secretAccessKey: thisisasecret
  sessionToken: thisisafakesessiontoken
  service: execute-api
  region: us-east-1
  profileName: test_profile
}

auth:basic {
  username: john
  password: secret
}

auth:wsse {
  username: john
  password: secret
}

auth:bearer {
  token: 123
}

auth:digest {
  username: john
  password: secret
}

auth:oauth2 {
  grant_type: authorization_code
  callback_url: http://localhost:8080/api/auth/oauth2/authorization_code/callback
  authorization_url: http://localhost:8080/api/auth/oauth2/authorization_code/authorize
  access_token_url: http://localhost:8080/api/auth/oauth2/authorization_code/token
  refresh_token_url: 
  client_id: client_id_1
  client_secret: client_secret_1
  scope: read write
  state: 807061d5f0be
  pkce: false
  credentials_placement: body
  credentials_id: credentials
  token_placement: header
  token_header_prefix: Bearer
  auto_fetch_token: true
  auto_refresh_token: true
}

body:json {
  {
    "hello": "world"
  }
}

body:text {
  This is a text body
}

body:xml {
  <xml>
    <name>John</name>
    <age>30</age>
  </xml>
}

body:sparql {
  SELECT * WHERE {
    ?subject ?predicate ?object .
  }
  LIMIT 10
}

body:form-urlencoded {
  apikey: secret
  numbers: +91998877665
  ~message: hello
}

body:multipart-form {
  apikey: secret
  numbers: +91998877665
  ~message: hello
}

body:file {
  file: @file(path/to/file.json) @contentType(application/json)
  file: @file(path/to/file.json) @contentType(application/json)
  ~file: @file(path/to/file2.json) @contentType(application/json)
}

body:graphql {
  {
    launchesPast {
      launch_site {
        site_name
      }
      launch_success
    }
  }
}

body:graphql:vars {
  {
    "limit": 5
  }
}

vars:pre-request {
  departingDate: 2020-01-01
  ~returningDate: 2020-01-02
}

vars:post-response {
  token: $res.body.token
  @orderNumber: $res.body.orderNumber
  ~petId: $res.body.id
  ~@transactionId: $res.body.transactionId
}

assert {
  $res.status: 200
  ~$res.body.message: success
}

script:pre-request {
  const foo = 'bar';
}

tests {
  function onResponse(request, response) {
    expect(response.status).to.equal(200);
  }
}

docs {
  This request needs auth token to be set in the headers.
}
