Lokalise APIv2 Elixir SDK

Elixir interface for the Lokalise APIv2.

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




Webhooks

Fetch webhooks

Doc

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

webhook = hd(webhooks.items)
webhook.webhook_id

Fetch a single webhook

Doc

{:ok, webhook} = ElixirLokaliseApi.Webhooks.find(project_id, webhook_id)

webhook.webhook_id

Create webhook

Doc

data = %{
  url: "http://bodrovis.tech/lokalise",
  events: ["project.imported"]
}

{:ok, webhook} = ElixirLokaliseApi.Webhooks.create(project_id, data)

webhook.url

Update webhook

Doc

data = %{
  events: ["project.exported"]
}

{:ok, webhook} = ElixirLokaliseApi.Webhooks.update(project_id, webhook_id, data)

webhook.webhook_id

Delete webhook

Doc

{:ok, resp} = ElixirLokaliseApi.Webhooks.delete(project_id, webhook_id)

resp.webhook_deleted

Regenerate webhook secret

Doc

{:ok, resp} = ElixirLokaliseApi.Webhooks.regenerate_secret(project_id, webhook_id)

resp.project_id
resp.secret