ves-io-schema-signup-CustomAPI-ListStates

Examples of performing signup CustomAPI ListStates

Usecase:

Perform ListStates on signup

Request:

Request using vesctl:

vesctl request rpc signup.CustomAPI.ListStates -i request.yaml --uri /no_auth/countries/country_code-literal/states/prefix-literal --http-method GET

where file request.yaml has following contents:

{}

vesctl yaml response:

states:
- additionalInfo: {}
  stateCode: TN
  stateName: Tamil Nadu

Request using curl:

curl -X 'GET' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build672621555_b001_apidocs.test/host=docker-desktop' 'https://localhost:57179/no_auth/countries/country_code-literal/states/prefix-literal?country_code=&prefix='

curl response:

HTTP/1.1 200 OK
Content-Length: 156
Content-Type: application/json
Date: Wed, 12 May 2021 11:18:45 GMT
Vary: Accept-Encoding

{
  "error_code": "EUNKNOWN",
  "states": [
    {
      "state_code": "TN",
      "state_name": "Tamil Nadu",
      "additional_info": {
      }
    }
  ]
}