Lokalise APIv2 Elixir SDK

Elixir interface for the Lokalise APIv2.

View the Project on GitHub lokalise/elixir-lokalise-api




Contributors

Fetch contributors

Doc

{:ok, contributors} = ElixirLokaliseApi.Contributors.all(project_id, page: 2, limit: 1)

contributor = hd contributors.items
contributor.user_id

Fetch a single contributor

Doc

{:ok, contributor} = ElixirLokaliseApi.Contributors.find(project_id, contributor_id)

contributor.user_id

Create contributors

Doc

data = %{
  contributors: [
    %{
      email: "elixir_test@example.com",
      fullname: "Elixir Rocks",
      languages: [
        %{
          lang_iso: "en",
          is_writable: false
        }
      ]
    }
  ]
}

{:ok, contributors} = ElixirLokaliseApi.Contributors.create(project_id, data)

contributor = hd contributors.items
contributor.email

Update contributor

Doc

data = %{
  is_reviewer: true
}

{:ok, contributor} = ElixirLokaliseApi.Contributors.update(project_id, contributor_id, data)

contributor.user_id

Delete contributor

Doc

{:ok, resp} = ElixirLokaliseApi.Contributors.delete(project_id, contributor_id)

resp.contributor_deleted