Skip to content

Latest commit

 

History

21 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Productive

A small Elixir client for the Productive REST API used by intranet.

Installation

Add productive to your list of dependencies in mix.exs:

def deps do
  [
    {:productive, git: "https://github.com/<org>/productive.git", tag: "v0.1.0"}
  ]
end

Usage

client =
  Productive.Client.new!(%{
    auth_token: "...",
    person_id: "...",
    organization_id: "..."
  })

{:ok, %{"data" => projects}} = Productive.get_projects(client, 1)
{:ok, %{"data" => entries}} =
  Productive.get_time_entries(client, %{
    project_id: "project-1",
    from: ~D[2026-03-01],
    to: ~D[2026-03-09],
    page: 1
  })

Public functions return {:ok, decoded_body} or {:error, %Productive.Error{}}. Bang variants such as Productive.get_projects!/2 and Productive.Client.new!/1 raise Productive.Error.

Productive.get_services/3 currently applies filter[budget_status]=1 and returns budgeted services for the given project.

Productive.get_tasks/3 searches tasks (filter[query], filter[project_id], page[size]). The optional third argument is forwarded to Req, e.g. receive_timeout: 10_000, retry: false.

Error handling

case Productive.create_time_entry(client, %{date: Date.utc_today(), time: 60, note: "", service_id: "123"}) do
  {:ok, body} ->
    body

  {:error, %Productive.Error{kind: :http_error, status: 422, body: body}} ->
    body

  {:error, %Productive.Error{} = error} ->
    raise error
end

Development

mix deps.get
mix test

About

Minimal Productive API client

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages