{
  "added": "2017-03-17T22:40:07.000Z",
  "info": {
    "description": "API for a tool to craftsmen used to register working hours, material usage and quality assurance.\n# Endpoint\nThe endpoint `https://app.apacta.com/api/v1` should be used to communicate with the API. API access is only allowed with SSL encrypted connection (https).\n# Authentication\nURL query authentication with an API key is used, so appending `?api_key={api_key}` to the URL where `{api_key}` is found within Apacta settings is used for authentication\n# Pagination\nIf the endpoint returns a `pagination` object it means the endpoint supports pagination - currently it's only possible to change pages with `?page={page_number}` but implementing custom page sizes are on the road map.\n\n\n# Search/filter\nIs experimental but implemented in some cases - see the individual endpoints' docs for further explanation.\n# Ordering\nIs currently experimental, but on some endpoints it's implemented on URL querys so eg. to order Invoices by `invoice_number` appending `?sort=Invoices.invoice_number&direction=desc` would sort the list descending by the value of `invoice_number`.\n# Associations\nIs currently implemented on an experimental basis where you can append eg. `?include=Contacts,Projects`  to the `/api/v1/invoices/` endpoint to embed `Contact` and `Project` objects directly.\n# Project Files\nCurrently project files can be retrieved from two endpoints. `/projects/{project_id}/files` handles files uploaded from wall posts or forms. `/projects/{project_id}/project_files` allows uploading and showing files, not belonging to specific form or wall post.\n# Errors/Exceptions\n## 422 (Validation)\nWrite something about how the `errors` object contains keys with the properties that failes validation like:\n```\n  {\n      \"success\": false,\n      \"data\": {\n          \"code\": 422,\n          \"url\": \"/api/v1/contacts?api_key=5523be3b-30ef-425d-8203-04df7caaa93a\",\n          \"message\": \"A validation error occurred\",\n          \"errorCount\": 1,\n          \"errors\": {\n              \"contact_types\": [ ## Property name that failed validation\n                  \"Contacts must have at least one contact type\" ## Message with further explanation\n              ]\n          }\n      }\n  }\n```\n## Code examples\nRunning examples of how to retrieve the 5 most recent forms registered and embed the details of the User that made the form, and eventual products contained in the form\n### Swift\n```\n```\n### Java\n#### OkHttp\n```\n  OkHttpClient client = new OkHttpClient();\n\n  Request request = new Request.Builder()\n    .url(\"https://app.apacta.com/api/v1/forms?extended=true&sort=Forms.created&direction=DESC&include=Products%2CCreatedBy&limit=5\")\n    .get()\n    .addHeader(\"x-auth-token\", \"{INSERT_YOUR_TOKEN}\")\n    .addHeader(\"accept\", \"application/json\")\n    .build();\n\n  Response response = client.newCall(request).execute();\n```\n#### Unirest\n```\n  HttpResponse<String> response = Unirest.get(\"https://app.apacta.com/api/v1/forms?extended=true&sort=Forms.created&direction=DESC&include=Products%2CCreatedBy&limit=5\")\n    .header(\"x-auth-token\", \"{INSERT_YOUR_TOKEN}\")\n    .header(\"accept\", \"application/json\")\n    .asString();\n```\n### Javascript\n#### Native\n```\n  var data = null;\n\n  var xhr = new XMLHttpRequest();\n\n  xhr.addEventListener(\"readystatechange\", function () {\n    if (this.readyState === 4) {\n      console.log(this.responseText);\n    }\n  });\n\n  xhr.open(\"GET\", \"https://app.apacta.com/api/v1/forms?extended=true&sort=Forms.created&direction=DESC&include=Products%2CCreatedBy&limit=5\");\n  xhr.setRequestHeader(\"x-auth-token\", \"{INSERT_YOUR_TOKEN}\");\n  xhr.setRequestHeader(\"accept\", \"application/json\");\n\n  xhr.send(data);\n```\n#### jQuery\n```\n  var settings = {\n    \"async\": true,\n    \"crossDomain\": true,\n    \"url\": \"https://app.apacta.com/api/v1/forms?extended=true&sort=Forms.created&direction=DESC&include=Products%2CCreatedBy&limit=5\",\n    \"method\": \"GET\",\n    \"headers\": {\n      \"x-auth-token\": \"{INSERT_YOUR_TOKEN}\",\n      \"accept\": \"application/json\",\n    }\n  }\n\n  $.ajax(settings).done(function (response) {\n    console.log(response);\n  });\n```\n#### NodeJS (Request)\n```\n  var request = require(\"request\");\n\n  var options = { method: 'GET',\n    url: 'https://app.apacta.com/api/v1/forms',\n    qs:\n     { extended: 'true',\n       sort: 'Forms.created',\n       direction: 'DESC',\n       include: 'Products,CreatedBy',\n       limit: '5' },\n    headers:\n     { accept: 'application/json',\n       'x-auth-token': '{INSERT_YOUR_TOKEN}' } };\n\n  request(options, function (error, response, body) {\n    if (error) throw new Error(error);\n\n    console.log(body);\n  });\n\n```\n### Python 3\n```\n  import http.client\n\n  conn = http.client.HTTPSConnection(\"app.apacta.com\")\n\n  payload = \"\"\n\n  headers = {\n      'x-auth-token': \"{INSERT_YOUR_TOKEN}\",\n      'accept': \"application/json\",\n      }\n\n  conn.request(\"GET\", \"/api/v1/forms?extended=true&sort=Forms.created&direction=DESC&include=Products%2CCreatedBy&limit=5\", payload, headers)\n\n  res = conn.getresponse()\n  data = res.read()\n\n  print(data.decode(\"utf-8\"))\n```\n### C#\n#### RestSharp\n```\n  var client = new RestClient(\"https://app.apacta.com/api/v1/forms?extended=true&sort=Forms.created&direction=DESC&include=Products%2CCreatedBy&limit=5\");\n  var request = new RestRequest(Method.GET);\n  request.AddHeader(\"accept\", \"application/json\");\n  request.AddHeader(\"x-auth-token\", \"{INSERT_YOUR_TOKEN}\");\n  IRestResponse response = client.Execute(request);\n```\n### Ruby\n```\n  require 'uri'\n  require 'net/http'\n\n  url = URI(\"https://app.apacta.com/api/v1/forms?extended=true&sort=Forms.created&direction=DESC&include=Products%2CCreatedBy&limit=5\")\n\n  http = Net::HTTP.new(url.host, url.port)\n  http.use_ssl = true\n  http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n  request = Net::HTTP::Get.new(url)\n  request[\"x-auth-token\"] = '{INSERT_YOUR_TOKEN}'\n  request[\"accept\"] = 'application/json'\n\n  response = http.request(request)\n  puts response.read_body\n```\n### PHP (HttpRequest)\n```\n  <?php\n\n  $request = new HttpRequest();\n  $request->setUrl('https://app.apacta.com/api/v1/forms');\n  $request->setMethod(HTTP_METH_GET);\n\n  $request->setQueryData(array(\n    'extended' => 'true',\n    'sort' => 'Forms.created',\n    'direction' => 'DESC',\n    'include' => 'Products,CreatedBy',\n    'limit' => '5'\n  ));\n\n  $request->setHeaders(array(\n    'accept' => 'application/json',\n    'x-auth-token' => '{INSERT_YOUR_TOKEN}'\n  ));\n\n  try {\n    $response = $request->send();\n\n    echo $response->getBody();\n  } catch (HttpException $ex) {\n    echo $ex;\n  }\n```\n### Shell (cURL)\n```\n\n  $ curl --request GET --url 'https://app.apacta.com/api/v1/forms?extended=true&sort=Forms.created&direction=DESC&include=Products%2CCreatedBy&limit=5' --header 'accept: application/json' --header 'x-auth-token: {INSERT_YOUR_TOKEN}'\n\n```",
    "title": "Apacta",
    "version": "0.0.42",
    "x-apisguru-categories": [
      "time_management",
      "project_management"
    ],
    "x-logo": {
      "url": "https://api.apis.guru/v2/cache/logo/https_twitter.com_apactadk_profile_image.png"
    },
    "x-origin": [
      {
        "format": "openapi",
        "url": "http://apidoc.apacta.com/swagger.yaml",
        "version": "3.0"
      }
    ],
    "x-providerName": "apacta.com"
  },
  "updated": "2023-03-06T07:12:59.965Z",
  "swaggerUrl": "https://api.apis.guru/v2/specs/apacta.com/0.0.42/openapi.json",
  "swaggerYamlUrl": "https://api.apis.guru/v2/specs/apacta.com/0.0.42/openapi.yaml",
  "openapiVer": "2.0",
  "link": "https://api.apis.guru/v2/specs/apacta.com/0.0.42.json"
}