https://linen.dev logo
#ask-community-for-troubleshooting
Title
# ask-community-for-troubleshooting
r

Rahul Padhy

05/25/2021, 11:41 AM
Hey everyone, hope you’re doing well. I’d a query wrt the Airbyte API. So, given a sourceDefinitionId, I’m trying to get a file-source as described here -> https://airbyte-public-api-docs.s3.us-east-2.amazonaws.com/rapidoc-api-docs.html#post-/v1/source_definitions/get. For this, I’m using the requests library in python and sending post request using json. But, even after verifying all my inputs, I’m still getting that my JSON format is invalid. So, this is my basic code :-
import requests
BASE_URL = '<http://localhost:8001/api>'
get_source = '/v1/sources/get'
file_source = {"sourceDefinitionId": "778daa7c-feaf-4db6-96f3-70fd645acc77"}
full_url = BASE_URL + get_source
response = <http://requests.post|requests.post>(full_url, json=file_source)
print (response.text)
And here’s the output that I’m getting :-
{"message":"Invalid JSON","details":"Unrecognized field \"sourceDefinitionId\" (class io.airbyte.api.model.SourceIdRequestBody), not marked as ignorable"}
I’d gotten the sourceDefinitionId for source type Files from the response of the list-all-sourceDefinitions endpoint -> https://airbyte-public-api-docs.s3.us-east-2.amazonaws.com/rapidoc-api-docs.html#post-/v1/source_definitions/list Please do tell me where I’m going wrong.
1
u

[DEPRECATED] Marcos Marx

05/25/2021, 11:48 AM
for the
/v1/sources/get
the request is
and the request you are sending is related with this endpoint here
r

Rahul Padhy

05/25/2021, 11:58 AM
Thanks, I made the change required, but this time I’m getting :-
{"message":"Could not find configuration for SOURCE_CONNECTION: 778daa7c-feaf-4db6-96f3-70fd645acc77."}
But, using the endpoint for getting info about all the sources, I’d gotten the above uuid for the File source.
{
"sourceDefinitionId":"778daa7c-feaf-4db6-96f3-70fd645acc77",
"name":"File",
"dockerRepository":"airbyte/source-file",
"dockerImageTag":"0.2.2",
"documentationUrl":"<https://hub.docker.com/r/airbyte/source-file>",
"icon":"<svg xmlns=\"<http://www.w3.org/2000/svg>\" enable-background=\"new 0 0 24 24\" viewBox=\"0 0 24 24\" fill=\"black\" width=\"24px\" height=\"24px\"><g><rect fill=\"none\" height=\"24\" width=\"24\"/><path d=\"M20.41,8.41l-4.83-4.83C15.21,3.21,14.7,3,14.17,3H5C3.9,3,3,3.9,3,5v14c0,1.1,0.9,2,2,2h14c1.1,0,2-0.9,2-2V9.83 C21,9.3,20.79,8.79,20.41,8.41z M7,7h7v2H7V7z M17,17H7v-2h10V17z M17,13H7v-2h10V13z\"/></g></svg>"
}
@[DEPRECATED] Marcos Marx Here’s the thread that I was talking about 🙂
u

[DEPRECATED] Marcos Marx

05/25/2021, 12:24 PM
POST /v1/source_definitions/get: will get data from the source itself, docker image, icon etc. POST /v1/sources/get: you need insert the id of the source you created, you can get this on the url page. I think this is not clear... maybe adding a field on the source page called sourceId