Sign in to participate

Be Kind, Be Helpful

Ask a question, answer a question, and get to know the fine people in the Harvest community.

Forum powered by Altered Beast
This is a Topic in API and Developers

API - get projects by code

Avatar

I’m building a ticketing system, and creating project codes that correspond to a particular ticket. I need to find the best way to get the project by code, and unfortunately /project?code=XX doesn’t seem to filter like I’d expect. Any ideas?

Thanks, much appreciated.

-Matt

Avatar

I should add that there is a type above – I’m using /projects?code=XX

I’d probably be able to work around this, except for that I don’t have a way to get back to the project id after creating it. (Using the API to create a project gives me an empty response with no contents, even though a valid project is created)

Also – I’d prefer to use the JSON api to create project, but I couldn’t seem to get it to roll. I’m guessing my syntax was incorrect, but I didn’t see any documentation of that stuff, as everything on the site is XML. I also didn’t get any error messages to indicate a flaw in my request.

Lots of stuff here, yes. I love harvest, and if I can finish this issue tracking system, I’m going to sleep a whole lot better, for sure.

Avatar

Hi @gilgm12

After you create a project using the API, a header is returned (Location) that will give you the ID of the new project you just created (/projects/#{new_project_id}). You can then use that to retrieve the project code from the API.

Hope that helps!

 

[ Please sign up to post a comment. ]