4
votes

If I want to extract the value for access token what should be the values for the below in Regular Expression Extractor

{"access_token":"YaTtnlYnqSuXIZ9K1BouYC3jgxjVQV6qpAyCnkv6","token_type":"Bearer","expires_in":28800,"refresh_token":"FkpJDh8c6x4xOp0o3GPb28kfSLVTPCZNCCiSSUZ4"},

Reference name: ?
Regular Expression: ?
Template: ?
Match No: ?
DefaultValue: ?

2
Hi, you can also upvote answer :-) thxUBIK LOAD PACK

2 Answers

3
votes

Your regular expression will be "access_token":"(\w+)" to extract the value for access token. See here to match the expression.

Reference name: Any_Variable_like_i.e_Var1
Regular Expression: "access_token":"(\w+)"
Template: $1$
Match No: 1
DefaultValue: No need to put any value there.

You can set your regular expression extractor like this: enter image description here

2
votes

It is better to use JSON Extractor

$..access_token for access_token

$..refresh_token for refresh_token

See:

enter image description here