Unable to parse my json response


#1

Hello,

I have been for ages on this one and cannot find an answer.

I have this json response from my API
{
“token_type”:“Bearer”,

“expires_in”:60,

“access_token”:“eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjkxOTJlNWMzODA0YjIzYWQwYTUzMjVlZmE0NGFjNTRmOTQ0OTM3MzkxMGExNWYyNTQ2MGM1Y2UyZDRlMjhhYzY4ZjM4ZmUyMzc3NDc5NThhIn0.eyJhdWQiOiIxIiwianRpIjoiOTE5MmU1YzM4MDRiMjNhZDBhNTMyNWVmYTQ0YWM1NGY5NDQ5MzczOTEwYTE1ZjI1NDYwYzVjZTJkNGUyOGFjNjhmMzhmZTIzNzc0Nzk1OGEiLCJpYXQiOjE1MTQ2NTI1NjQsIm5iZiI6MTUxNDY1MjU2NCwiZXhwIjoxNTE0NjUyNjI0LCJzdWIiOiIxIiwic2NvcGVzIjpbIioiXX0.msfTwOlTfBMnrA9g2do0ftvFtoxTJ32E3Jbf64FPQtt-_BeTL5UAd5v3OsNpviXOEKYgF_mP3HfcYrs_37q-TI0oQV81-QH51Ci0OcyrP3TkJzpwqOOHqDUI7sd1VVm6Kxa3VLznJSz1KXxIXOKnFfeDtSlp83baLFUuTJ-Am-TR08TUt_n4eviQS3WoYTiHT0goo9byF3ZVVKoxVpXSZWxt0eYq7ng0vlYMBSj6U7ge6dAPqGt4oiMzdZ16yeb5jQVIFLBksi4_HgsJoHbWhRxRIqrZnNy_7ETup1siUrvO-Mpr72sSgu_6AL0o9Z2esO9BCepv9BRY-OZktU5PJITOeaOL33pdGwDKPDmvIJbsklcKMqoNos7QZapS2nm9cVE2O3L8d1AUnP0c1UskkSwjrYeQA79CLP1nvAk9Ri4WvzO62Ir2PcGZwSx8Qex6OP5FSW-XgkACwVU5NJS6Nf7tMaydYF0-8YBCIti9qCo634pRPOFxoPM6dzeqmFJ3S8bwcreXzFxXPmpGgqQgSObG6Gp7jimKLeOOuF_85C3fFQrbDS_5xgtJYj–d_FcPQ-XrmsWjcrwid_HcWCssvs2-THOBJz6jidQIszOHnc5IqVPrqet0PcYU535WOgrE_tJ5E16NAJ8IZFz20RJ-lOpFQCYzevUXdDu5s0wQV8”,

“refresh_token”:“def50200f0fcba9f377bdf9ba6da8b9888c21aeff8c739c271d49d4253dc7fbcda3f887452434494d051222314e283dafccc143e43f51d44517503c02476868e079281e003cc022c2fed9327a9cdbf4a7c5b9b3a7f875468cc77c3a180e90cbb079a212ce0eaa1f9ab77fefeb96245fb37b57ce7975b747c3d5f41560888f1f6e424fb884f94b453a8a4d951c0d6f661d056a699c31399d927619c64a1a869c16e5d5e6771acd202b47a28c90e1d43b2af31b5ed3e7121f18d06bfe2f675d0d0b21cca786c2d7719c91dedc038d5856de3ad1c4912fd68f67f520f959aba7a8180b62cbf6523f722e49fc2133c8dcd17a4c511bd65061e05223ef2d181ecb60de42b710c6a740580aae7965e7ee43e74b01bf6fab6b1daab8cf33eb3cbf65fba5167c85412fa5e9c0ee5fd79a8125df8bd98ea58a4589f11ee3a67ebd157fc691d388b116059fa1ade10fcc31bf170e132ee1d254f7189a38982122a4d3ed0cbd02cb8b5”

}

I cannot find away to save the values of access_token and refresh_token

I tried different list possibilities and even added some together or removed the json parse, all failed.


#2

Use find in pair with key method.
Where key should be access_token and refresh_token.


#3

Thanks yes I tried this one too but no luck, I get this error

The operation lookup in pairs cannot accept the arguments: , [“access_token”], [{“token_type”:“Bearer”,“expires_in”:60,“access_token”:“eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjdjOWIxZDQ4YzFmZWFiZDVkODMwYjk1MTNiN2VhYzlhZWE1NzNmYTBhMmNhNDgzOGQ3YzQxMGE3YWQ5MzkxY2FhOWJjY2Q0ZjhjYTdkOWZiIn0.eyJhdWQiOiIxIiwianRpIjoiN2M5YjFkNDhjMWZlYWJkNWQ4MzBiOTUxM2I3ZWFjOWFlYTU3M2ZhMGEyY2E0ODM4ZDdjNDEwYTdhZDkzOTFjYWE5YmNjZDRmOGNhN2Q5ZmIiLCJpYXQiOjE1MTQ2NTcwNTUsIm5iZiI6MTUxNDY1NzA1NSwiZXhwIjoxNTE0NjU3MTE1LCJzdWIiOiIxIiwic2NvcGVzIjpbIioiXX0.XRjERpRP_ITutTNQJlmhKDBGqjWLPXN-2sgLaT4r-0FW_vv1eoy6N3RLTVO-AT3NoQeYC4porjoJTK2nXPot5QEp8IxnymMygv0H8Y6klRXHPeqzU30Ebuau66MDShieGn8DKP-5wDkTfzncY0-vBh4T5tFtXbtnCf2f7SypTlM5Eg3RClqecki7NOuX9dbgoZf_UwN5u3FqI5lcVjM5mawr7PQPqCx-0dhR7EZGbD5ys81-ShdZhotkoY4JAVAlzrK32R9hBGwpYvf-SBjUdDfXcLSWU1cwJ7TNnOcrdUe7ISdNkuPZmxIXG9cNgBSn8aUxqMcTNdSBj_yKo0m8Ab2R8x2tkSwcru7tQiwLE1MXXgYuQZKgu041wRHdY3S9D0yxsCR-tIGns1F4sjBRQzkEEDMMF3PmgQSPlqilcN3jBCF-vh_MAjNQJJJLK4bmqrDhWM79VvvmadVoLOAgShYGh6aOB2uBXtS1zRsNKRYe9icncsQL0BYWeJzYDZaZKbychF4huvs4quXCSG6nF113a9IBLtoLFzRXT0u21ibnWVAOmoY_G_dhX9z-drb-a5JrwnrrMq0be9xilaTHbC0JSeyo-rzRnkh5Xa0uYpj74dVTenzd_z3Tb3PhwCGogdv_4Pc3Ft_HPJxhUui5y3MKI79EJZRk9EzeXGVeeYs”,“refresh_token”:“def50200585b206e30bebe381ccc2447d8852bffcb5b47f90aa0dd74c58b62d5919893770e5448bca8a2a6770e8b1f486ef8fa8cca18d83b7a53909546c63acc9d179c7e79d6b7fe2f26a12c69a646c423cb8e34ea55c679c29b2b86c701b6d6f283e125d6fc90158d0b3a8ecd74c3213112eb8185ddf1601fc43c75a6bf4948897ab78d35a2e45df38bcd2421f49845675301f54c2c98cbcdd40e2f7aacf1c339ceaa61689d43cd32e68db1d4587ea4fffe8bb38c6876ec711e4f33288eac8a2674ed4580bacdac6668d343cba2872107afca837dba0fbbec7f4f5a6248b3c6dcd864dec63c5e409b8239e9cf579b011ef1271625e2e5af161bf3eab36a254be49e5debb294ded585af5251d8d174843e082f78e7950587bc42a8e32cc83660ee6189ad2a506a53af4c6bbc17a3c712d958e934a4a9057dee3506e0de85a797be7f4c5001203835affdaf6ba6c0c64701f73c1304a8f591182f34653d4f2941ea6cea1b”}], [not found]
Note: You will not see another error reported for 5 seconds.


#4

First decode ( response content ) json with web component (you have done in first picture) and then pass to pair.

See below image :


Help decoding and using JSON
#5

Thanks, yes it is working! Superb!


#6

Here’s some more information on working with JSON responses from APIs:

EDIT:

I just saw this post now:

You probably have no need for the first link I posted! :grinning:


#7

Thanks!