Get organization by name

:warning: noob alert :warning:

Hi there,

I’m aware of the endpoint GET /v1/organizations/search - however, being a noob and finding no worked example anywhere, I just can’t seem to figure it out.

So, I put it to anyone kind enough to answer:

How do I get an Org ID by the Org’s name?

Many, many thanks,
Michael

Hi @Michael_Fratta,

What kind of a worked example are you looking for?
Also, how are you making your API calls? Are you using Postman? :slightly_smiling_face:

For this particular endpoint, the search term you use has to contain a minimum of 2 characters.
I just ran this endpoint and used 2 characters “ca” to run my search. These are the results I got along with ID of the company:

I hope this helps?

1 Like

Hi @Nicole_Tan
So sorry for the late response - Gmail marked this as spam :man_facepalming:t5:
I’m using a mix of web browser, Jupyter Notebook (Python) and VS Code, actually; but - your example is all I needed, as I can see an example of the URL call in the GET request: which is exactly what I was looking for! :sparkles:
Thank you so very much! :pray:t5:

1 Like

Hi @Michael_Fratta, good you checked your spam then! :grin:
You’re most welcome. I’m glad you got what you’re looking for. :v:

1 Like

Hi @Nicole_Tan
How can I get a organization by unique attributes like name or other using ruby gem ‘pipedrivepipedrive
when I try by name,
client = ::Pipedrive::Organization.new(ENV[‘PIPEDRIVE_API_TOKEN’])
client.find_by_name(‘name’) , it return result like
#<Enumerator: #<Pipedrive::Organization:0x00007f06a0ab8210 @api_token=“my_api_token”>:find_by_name(term: name)>

Kindly guide about it.

Thanks.

Hi @ali527,

The Ruby repository you are using is a community-run repository. As we don’t own it, unfortunately, I am unable to help guide you.

Perhaps you can ask within the repository by raising an issue?

@Nicole_Tan Thanks for your reply.
Well, How to get unique organization with the help of API endpoint i.e. using name or other fields?

@ali527 Have you tried the solution provided above?
With the GET /v1/organizations/search endpoint, the search term you use has to contain a minimum of 2 characters.

@Nicole_Tan Thanks for your quick response. Well, I tired it with following URL.
“https://#{ENV[‘PIPEDRIVE_COMPANY_DOMAIN’]}.pipedrive.com/api/v1/organizations/search/?term=#{company.name}&exact_match=true&limit=1&fields=name&api_token=#{ENV[‘PIPEDRIVE_API_TOKEN’]}”

Hi @ali527,

What was your result of trying with that URL?

For the GET /v1/organizations/search endpoint, the required parameter is the search term. It has to have at least two characters.

If you want to search by company name, add name to the fields parameter, for example:
https://{COMPANYDOMAIN}.pipedrive.com/api/v1/organizations/search?term={YOUR OWN TERM}&fields=name&start=0.

You can use the fields parameter to specify which field the search should be done in.

Here is what I did in Postman. I ran a search for Organizations with the search term ca and added name to the field parameter so that it searches the name of the Organizations.