MAAS API - How To With Postman

MAAS api only supports oauth1. How can I access maas from Postman? Maas provides a single 3 part api string called MAAS consumer. The parts are split into CONSUMER_KEY, OAUTH_TOKEN, OAUTH_SIGNATURE. In Postman oauth1 expects 4 values; consumer_key, consumer_secret, access_token, token_secret. How do the maas values map into postman and where is the 4th value?

Hi @maas-oh-boy

IIRC Postman doesn’t support OAuth1.
You can create a pre-request script to obtain the token and store it in the env variable.

Here is how you can get the token:

curl --header "Authorization: OAuth oauth_version=1.0, oauth_signature_method=PLAINTEXT, oauth_consumer_key=$API_KEY[1], oauth_token=$API_KEY[2], oauth_signature=&$API_KEY[3], oauth_nonce=$(uuidgen), oauth_timestamp=$(date +%s)" \
$MAAS_URL/MAAS/api/2.0/users/

Where $API_KEY[N] is the n-th part of API_KEY split by :