{"action":"created","issue":{"url":"https://api.github.com/repos/pritunl/pritunl/issues/426","repository_url":"https://api.github.com/repos/pritunl/pritunl","labels_url":"https://api.github.com/repos/pritunl/pritunl/issues/426/labels{/name}","comments_url":"https://api.github.com/repos/pritunl/pritunl/issues/426/comments","events_url":"https://api.github.com/repos/pritunl/pritunl/issues/426/events","html_url":"https://github.com/pritunl/pritunl/issues/426","id":166931553,"number":426,"title":"PHP API","user":{"login":"VPNSystems","id":18371686,"avatar_url":"https://avatars.githubusercontent.com/u/18371686?v=3","gravatar_id":"","url":"https://api.github.com/users/VPNSystems","html_url":"https://github.com/VPNSystems","followers_url":"https://api.github.com/users/VPNSystems/followers","following_url":"https://api.github.com/users/VPNSystems/following{/other_user}","gists_url":"https://api.github.com/users/VPNSystems/gists{/gist_id}","starred_url":"https://api.github.com/users/VPNSystems/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VPNSystems/subscriptions","organizations_url":"https://api.github.com/users/VPNSystems/orgs","repos_url":"https://api.github.com/users/VPNSystems/repos","events_url":"https://api.github.com/users/VPNSystems/events{/privacy}","received_events_url":"https://api.github.com/users/VPNSystems/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/pritunl/pritunl/labels/invalid","name":"invalid","color":"e6e6e6"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-21T22:22:57Z","updated_at":"2016-07-22T00:29:36Z","closed_at":"2016-07-22T00:11:41Z","body":"I'm trying to set the user id as a variable so I can intergrate with my CMS.\r\n\r\nBasically can't pull the user-id from the JSON array (i've tried using rebex). \r\n\r\nWould be helpful if there was some support for this, or an API request to pull a user id with just a username/email. Code posted below.\r\n\r\n`<?php\r\n\r\n$BASE_URL   = \"https://nl.dummysite.net\";\r\n$API_TOKEN  = \"dummytoken\";\r\n$API_SECRET = \"dummysecret\";\r\n\r\nfunction auth_request($method, $path, $data=\"\") {\r\n    global $BASE_URL, $API_TOKEN, $API_SECRET;\r\n\r\n    $auth_timestamp = strval(time());\r\n    $auth_nonce = uniqid();\r\n    $auth_array = array(\r\n        $API_TOKEN,\r\n        $auth_timestamp,\r\n        $auth_nonce,\r\n        strtoupper($method),\r\n        $path,\r\n    );\r\n    if ($data) {\r\n        array_push($auth_array, $data);\r\n    }\r\n\r\n    $auth_string = join(\"&\", $auth_array);\r\n    $auth_signature = base64_encode(hash_hmac(\r\n        \"sha256\", $auth_string, $API_SECRET, true));\r\n    $options = array(\r\n        \"http\" => array(\r\n            \"header\"  => array(\r\n                'Content-Type: application/json',\r\n                'Auth-Token: '.$API_TOKEN,\r\n                'Auth-Timestamp: '.$auth_timestamp,\r\n                'Auth-Nonce: '.$auth_nonce,\r\n                'Auth-Signature: '.$auth_signature\r\n            ),\r\n            \"method\"  => $method,\r\n            \"content\" => $data,\r\n        ),\r\n    );\r\n\r\n    $context = stream_context_create($options);\r\n    return file_get_contents($BASE_URL.$path, false, $context);\r\n};\r\n\r\nprintf(auth_request(\"POST\", \"/user/dummyoriginization\",\r\n    json_encode(array(\r\n        \"name\" => \"new_user\",\r\n        \"email\" => \"new_user@email.com\",\r\n        \"disabled\" => False\r\n        ))\r\n).\"\\n\"); // Adds user to orginization\r\n\r\n//Need to set user-id as a variable $user-id for further intergration\r\n\r\n\r\n\r\n?>`"},"comment":{"url":"https://api.github.com/repos/pritunl/pritunl/issues/comments/234423625","html_url":"https://github.com/pritunl/pritunl/issues/426#issuecomment-234423625","issue_url":"https://api.github.com/repos/pritunl/pritunl/issues/426","id":234423625,"user":{"login":"k0nsl","id":2517921,"avatar_url":"https://avatars.githubusercontent.com/u/2517921?v=3","gravatar_id":"","url":"https://api.github.com/users/k0nsl","html_url":"https://github.com/k0nsl","followers_url":"https://api.github.com/users/k0nsl/followers","following_url":"https://api.github.com/users/k0nsl/following{/other_user}","gists_url":"https://api.github.com/users/k0nsl/gists{/gist_id}","starred_url":"https://api.github.com/users/k0nsl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/k0nsl/subscriptions","organizations_url":"https://api.github.com/users/k0nsl/orgs","repos_url":"https://api.github.com/users/k0nsl/repos","events_url":"https://api.github.com/users/k0nsl/events{/privacy}","received_events_url":"https://api.github.com/users/k0nsl/received_events","type":"User","site_admin":false},"created_at":"2016-07-22T00:29:36Z","updated_at":"2016-07-22T00:29:36Z","body":"@VPNSystems: I hope you're actually not paying  for a subscription... I have never seen someone on GitHub close issues the way @zachhuff386 does it. It's incredible. It's an art form for him, I'm sure.\r\nI could never hire that PR nightmare for my company. Now, don't get me wrong @zachhuff386: your application is good, but I find your attitude lacking (to put it mildly)."}}
{"actor":{"display_login":"k0nsl"}}