I have below mentioned dataframe in R:
DF
ID Code
PO-1 123
PO-3 345
PO-4 222
I want to pass the ID
in api get specific response from the JSON.
I have the api like "https://test.com/path/code-info?ID=PO-1" with header code(x892edrsre34434f).
JSON Format:
{"test":1,"FormDetails":{"CusName":"Alex",
"City":"NYC","limit":null,"pincode":null,
"refID":"123456",
"channelID":"YUT009"}}
I want to extract the CusName
and refID
from API output for each ID
and rbind
it with my DF
to get the following output.
ID Code CusName refID
PO-1 123 Alex YUT009
PO-3 345 Carla YUT098
PO-4 222 Tim YUT124
I have tried:
Get_Df<-GET("https://***.com",
path = "path/code-info?Id=",
query = "PO-1",
add_headers(token, API key))