portman icon indicating copy to clipboard operation
portman copied to clipboard

Describe 2/3 curly braces and preRequestScripts

Open jpjpjp opened this issue 1 year ago • 0 comments

I updated the examples covering the overwrite directive to call out the difference of setting a variable to '{{postmanStringVar}}' vs. '{{{postmanNumVar}}}' when using overwriteRequestBody. ``` I also created a new testsuite-pre-request-scripts example, demonstrating how to use a pre-request script to modify a numeric value in a postman environment variable and use it in a subsequent request.

The preRequestExample uses a variable stored from the monetary_amount property in a lead. I think this will work as defined, but I was unable to make an authorized request to https://unify.apideck.com/crm/leads. I did manage to create an account with an API Key and AppId, and also to set up a consumerId, but I couldn't quite figure out how to get past this error:

{
    "status_code": 401,
    "error": "Unauthorized",
    "type_name": "ConnectorCredentialsError",
    "message": "Crm Connector not authorized.",
    "detail": "Unable to find item. Are you sure this consumer has active connections? Use Vault to create a connection.",
    "ref": "https://developers.apideck.com/errors#connectorcredentialserror"
}

Consequently, I'm not sure if my assignVariables script actually works, so the script in testsuite-pre-request-scripts is somewhat untested.

jpjpjp avatar Jul 01 '24 15:07 jpjpjp