Question
I am sending a GET API request in Qubole to fetch duplicate households from Reltio. The API is responding with an empty string in the Qubole script, but it is giving a full result if I run the same API in POSTMAN.
API:
https://<environment>.reltio.com/reltio/api/<tentant>/entities?filter=(equals(type, 'configuration/entityTypes/Contact') and gte(attributes.AssociatedHousehold.count, 2)) and equals(type, 'configuration/entityTypes/Contact')&max=25&offset=0&options=ovOnly&select=uri,type,attributes.AssociatedHousehold.refRelation
Qubole Code:
import scala.sys.process._
val HHapi =Seq("curl", "-X", "GET" ,"https://<environment>.reltio.com/reltio/api/<tenantId>/entities?filter=(equals(type, 'configuration/entityTypes/Contact') and gte(attributes.AssociatedHousehold.count, 2)) and equals(type, 'configuration/entityTypes/Contact')&max=25&offset=0&options=ovOnly&select=uri,type,attributes.AssociatedHousehold.refRelation", "-H", "Authorization: Bearer bd7d7f8c-477b-42fc-ac7b-a7217f252360", "-H", "Content-Type: application/json")
val result = HHapi.!!
println(result)
Answer
Modify your Qubole query and encode your API URL.
val HHapi =Seq("curl", "-X", "GET" ,"https://<environment>.reltio.com/reltio/api/<tenantId>/entities?filter=equals(type%2C%20'configuration%2FentityTypes%2FContact')&filter=gte(attributes.AssociatedHousehold.count%2C%202)&max=25&offset=0&options=ovOnly&select=uri,type,attributes.AssociatedHousehold.refRelation", "-H", "Authorization: Bearer bd7d7f8c-477b-42fc-ac7b-a7217f252360", "-H", "Content-Type: application/json")
val result = HHapi.!!
println(result)
Comments
Please sign in to leave a comment.