Content Types

Use any of the following Content-Type values for PATCH, POST, and PUT requests:

application-x-www-form-urlencoded

curl -i -X POST {{ page.sg-domain }}/whitelist_accounts \
-u {{ page.sg-id }}:{{ page.sg-password }} \
-H "sg-version: {{ page.sg-version }}" \
-d sort_code ={{ 'sort_code' | field_sample }} \
-d account_number ={{ 'account_number' | field_sample }} \
-d max_amount ={{ 'max_amount' | field_sample }} \
-d max_frequency ={{ 'max_frequency' | field_sample }}

application/json

curl -i -X POST {{ page.sg-domain }}/whitelist_accounts \
-u {{ page.sg-id }}:{{ page.sg-password }} \
-H "sg-version: {{ page.sg-version }}" \
-H "Content-Type: application/json" \
-d '{"sort_code": "{{ 'sort_code ' | field_sample }}", "account_number": "{{ 'account_number ' | field_sample }}", "max_amount": {{ 'max_amount ' | field_sample }}, "max_frequency": {{ 'max_frequency ' | field_sample }}}'

application/jwt

Note: Only the JSON Web Token (JWT) request type supports request signing.

Unsecured JWT

curl -i -X POST {{ page.sg-domain }}/whitelist_accounts \
-u {{ page.sg-id }}:{{ page.sg-password }} \
-H "sg-version: {{ page.sg-version }}" \
-H "Content-Type: application/jwt" \
-d 'eyJ0eXAiOiJKV1QiLCJhbGciOiJub25lIn0.eyJzb3J0Y29kZSI6IjQwNDg2NSIsImFjY291bnQiOiI2MjEzNjAxNiIsIm1heF9hbW91bnQiOjEwMDAwMDAsIm1heF9mcmVxdWVuY3kiOjF9.'

Header

{
"alg": "none",
"typ": "JWT"
}

Payload

"account_number": "{{ 'account_number' | field_sample }}",
"max_amount": {{ 'max_amount' | field_sample }},
"max_frequency": {{ 'max_frequency' | field_sample }},
"sort_code": "{{ 'sort_code' | field_sample }}"
}

Secured JWT

curl -i -X POST {{ page.sg-domain }}/whitelist_accounts \
-u {{ page.sg-id }}:{{ page.sg-password }} \
-H "sg-version: {{ page.sg-version }}" \
-H "Content-Type: application/jwt" \
-d 'eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiJ9.eyJpc3MiOiJrZXlfM0lWODEwQVJjaFQ2Q25TTjJlTEJWcyIsImlhdCI6MTQ2Nzc1NTIzMiwic29ydGNvZGUiOiI0MDQ4NjUiLCJhY2NvdW50IjoiNjIxMzYwMTYiLCJtYXhfYW1vdW50IjoxMDAwMDAwLCJtYXhfZnJlcXVlbmN5IjoxfQ.-XjfvV5_1Cs2K6GpORWPIjvjEJzwjALaOP9ZXReH2GVzB_MDP7eVSND3UglBpR7KakmBaj7SdmDaMZtCta0uDQ'

Header

{ "alg": "ES256",
"typ": "JWT"
}

Payload

"iss": "{{ page.sg-id }}",
"iat": 1467755321,
"account_number": "{{ 'account_number' | field_sample }}",
"max_amount": {{ 'max_amount' | field_sample }},
"max_frequency": {{ 'max_frequency' | field_sample }},
"sort_code": "{{ 'sort_code' | field_sample }}"
}