Hello everyone, I'm working with the Airbyte API ...
# replication-troubleshooting
l
Hello everyone, I'm working with the Airbyte API and I need to access a source, destination or connection by name. So I'm using the search method. For example to get a source by its name I'm using
*POST* /v1/sources/search
with the following body
{"name": "mySourceName"}
. However It doesn't seems to work. Adding the workspaceId doesn't change anything. Is it an issue ? Or I'm missing something ?
e
Hi. What do you mean by access a source? If you wish to get a source use:
*POST* /v1/source_definitions/get
updating the source will be done at :
*POST* /v1/source_definitions/update
l
Both of them are for
source_definitions
. I'm talking about the
source
. Moreover, I want to get a created source by the name given when it was created.
e
What I wrote is the way to get the source it self- using the endpoint you have provided shows the current input of the source it self while source_definition shows only the ids + name you need. so skipping this process gives you the endpoints I gave you and using update or get source definition will give you the same results++. I dont see a reason to ever you the search endpoint since the data it requires is available via source_definition. getting by name is bad practice since you can have 2 sources with the same name with different ids. use source definition to get the source id of a created new source. you can get the source id by using source_definition create and update using the update endpoint.
the flow we use. create source_definition + get source_id ->>> update source_definition for dynamic date ranges or if you need to search sources for dynamically running them by name (note I would use this only if you have conventions for naming's so no conflict will occur) you can use:
v1/connections/list_all
this will give you the source id, name and connection id and name and then just run jobs endpoint
l
Oh thanks I see now ! Both of them are fine for me, thanks a lot ! By the way, I agree of using name to handle sources (or other) is a bad practice. However we have a special use case where each source, destination and connection is only for 1 of our customer. So there will never be two source with the same name (because it is in fact a customer id).
e
yes- in this case this is great way to make it work easy glad I could help 🙂
✅ 1
🙏 1