{"action":"closed","number":15,"pull_request":{"url":"https://api.github.com/repos/BCLibraries/primo-services/pulls/15","id":50422551,"html_url":"https://github.com/BCLibraries/primo-services/pull/15","diff_url":"https://github.com/BCLibraries/primo-services/pull/15.diff","patch_url":"https://github.com/BCLibraries/primo-services/pull/15.patch","issue_url":"https://api.github.com/repos/BCLibraries/primo-services/issues/15","number":15,"state":"closed","locked":false,"title":"Fix so AlmaClient chooses correct Alma ID","user":{"login":"danmichaelo","id":434495,"avatar_url":"https://avatars.githubusercontent.com/u/434495?v=3","gravatar_id":"","url":"https://api.github.com/users/danmichaelo","html_url":"https://github.com/danmichaelo","followers_url":"https://api.github.com/users/danmichaelo/followers","following_url":"https://api.github.com/users/danmichaelo/following{/other_user}","gists_url":"https://api.github.com/users/danmichaelo/gists{/gist_id}","starred_url":"https://api.github.com/users/danmichaelo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danmichaelo/subscriptions","organizations_url":"https://api.github.com/users/danmichaelo/orgs","repos_url":"https://api.github.com/users/danmichaelo/repos","events_url":"https://api.github.com/users/danmichaelo/events{/privacy}","received_events_url":"https://api.github.com/users/danmichaelo/received_events","type":"User","site_admin":false},"body":"Breaking change: I changed the `alma_ids` from\r\n\r\n    ['institution1:id1', 'institution2:id2']\r\n\r\nto\r\n\r\n    ['institution1' => 'id1', 'institution2' => 'id2']\r\n\r\nto make it easier to consume. I should have realized in #13, but I'm still struggling to get my head around the API response format, which is really dense. Sorry about that. (A new version bump is probably not needed since the commit is only two days old and we're still on 0.x.)\r\n\r\n---\r\n\r\nSome background:\r\n\r\nOur library is part of a network zone consortium, which is probably why I run into a few issues. If you're interested, I've put up an example response here: https://gist.github.com/danmichaelo/6d5611592e396945b7a2\r\n\r\nIn short, `delivery` looks like this (notice the `$$I`s):\r\n\r\n````\r\n\"delivery\" : {\r\n   \"delcategory\" : [\r\n      \"Alma-P$$IBIBSYS\",\r\n      \"Alma-P$$ISINTEF\",\r\n      \"Alma-P$$IUBO\"\r\n   ],\r\n   \"institution\" : [\r\n      \"BIBSYS\",\r\n      \"SINTEF\",\r\n      \"UBO\"\r\n   ]\r\n}\r\n````\r\n\r\nand `control` like this:\r\n\r\n```json\r\n{\r\n   \"sourcesystem\" : \"Alma\",\r\n   \"sourceformat\" : \"MARC21\",\r\n   \"sourcerecordid\" : \"71354134370002201\",\r\n   \"recordid\" : \"BIBSYS_ILS71354134370002201\",\r\n   \"almaid\" : [\r\n      \"47BIBSYS_NETWORK:71354134370002201\",\r\n      \"47BIBSYS_SINTEF:213995760002287\",\r\n      \"47BIBSYS_UBO:2113615280002204\"\r\n   ],\r\n   \"sourceid\" : \"BIBSYS_ILS\",\r\n   \"addsrcrecordid\" : \"990918105824702201\"\r\n}\r\n```\r\n\r\nSince I'm setting `$library` to `47BIBSYS_UBO`, I'm not interested in the `sourcerecordid` (which is the NZ id), but the ID for `47BIBSYS_UBO` (2113615280002204). So that's what my PR is about.\r\n\r\nI *think* the PR shouldn't break responses like the one in `brief-search-result-local-01.json`, but testing is needed :)","created_at":"2015-11-11T19:08:51Z","updated_at":"2015-11-12T15:20:10Z","closed_at":"2015-11-12T15:20:10Z","merged_at":"2015-11-12T15:20:10Z","merge_commit_sha":"3d98e54c242b97bc430bd08cdb0b9028bb062785","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/BCLibraries/primo-services/pulls/15/commits","review_comments_url":"https://api.github.com/repos/BCLibraries/primo-services/pulls/15/comments","review_comment_url":"https://api.github.com/repos/BCLibraries/primo-services/pulls/comments{/number}","comments_url":"https://api.github.com/repos/BCLibraries/primo-services/issues/15/comments","statuses_url":"https://api.github.com/repos/BCLibraries/primo-services/statuses/0808d84f5ba85de48c20d3a75009aa267dd8b13a","head":{"label":"scriptotek:alma-avail","ref":"alma-avail","sha":"0808d84f5ba85de48c20d3a75009aa267dd8b13a","user":{"login":"scriptotek","id":3192646,"avatar_url":"https://avatars.githubusercontent.com/u/3192646?v=3","gravatar_id":"","url":"https://api.github.com/users/scriptotek","html_url":"https://github.com/scriptotek","followers_url":"https://api.github.com/users/scriptotek/followers","following_url":"https://api.github.com/users/scriptotek/following{/other_user}","gists_url":"https://api.github.com/users/scriptotek/gists{/gist_id}","starred_url":"https://api.github.com/users/scriptotek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scriptotek/subscriptions","organizations_url":"https://api.github.com/users/scriptotek/orgs","repos_url":"https://api.github.com/users/scriptotek/repos","events_url":"https://api.github.com/users/scriptotek/events{/privacy}","received_events_url":"https://api.github.com/users/scriptotek/received_events","type":"Organization","site_admin":false},"repo":{"id":23225198,"name":"primo-services","full_name":"scriptotek/primo-services","owner":{"login":"scriptotek","id":3192646,"avatar_url":"https://avatars.githubusercontent.com/u/3192646?v=3","gravatar_id":"","url":"https://api.github.com/users/scriptotek","html_url":"https://github.com/scriptotek","followers_url":"https://api.github.com/users/scriptotek/followers","following_url":"https://api.github.com/users/scriptotek/following{/other_user}","gists_url":"https://api.github.com/users/scriptotek/gists{/gist_id}","starred_url":"https://api.github.com/users/scriptotek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scriptotek/subscriptions","organizations_url":"https://api.github.com/users/scriptotek/orgs","repos_url":"https://api.github.com/users/scriptotek/repos","events_url":"https://api.github.com/users/scriptotek/events{/privacy}","received_events_url":"https://api.github.com/users/scriptotek/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scriptotek/primo-services","description":"","fork":true,"url":"https://api.github.com/repos/scriptotek/primo-services","forks_url":"https://api.github.com/repos/scriptotek/primo-services/forks","keys_url":"https://api.github.com/repos/scriptotek/primo-services/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scriptotek/primo-services/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scriptotek/primo-services/teams","hooks_url":"https://api.github.com/repos/scriptotek/primo-services/hooks","issue_events_url":"https://api.github.com/repos/scriptotek/primo-services/issues/events{/number}","events_url":"https://api.github.com/repos/scriptotek/primo-services/events","assignees_url":"https://api.github.com/repos/scriptotek/primo-services/assignees{/user}","branches_url":"https://api.github.com/repos/scriptotek/primo-services/branches{/branch}","tags_url":"https://api.github.com/repos/scriptotek/primo-services/tags","blobs_url":"https://api.github.com/repos/scriptotek/primo-services/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scriptotek/primo-services/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scriptotek/primo-services/git/refs{/sha}","trees_url":"https://api.github.com/repos/scriptotek/primo-services/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scriptotek/primo-services/statuses/{sha}","languages_url":"https://api.github.com/repos/scriptotek/primo-services/languages","stargazers_url":"https://api.github.com/repos/scriptotek/primo-services/stargazers","contributors_url":"https://api.github.com/repos/scriptotek/primo-services/contributors","subscribers_url":"https://api.github.com/repos/scriptotek/primo-services/subscribers","subscription_url":"https://api.github.com/repos/scriptotek/primo-services/subscription","commits_url":"https://api.github.com/repos/scriptotek/primo-services/commits{/sha}","git_commits_url":"https://api.github.com/repos/scriptotek/primo-services/git/commits{/sha}","comments_url":"https://api.github.com/repos/scriptotek/primo-services/comments{/number}","issue_comment_url":"https://api.github.com/repos/scriptotek/primo-services/issues/comments{/number}","contents_url":"https://api.github.com/repos/scriptotek/primo-services/contents/{+path}","compare_url":"https://api.github.com/repos/scriptotek/primo-services/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scriptotek/primo-services/merges","archive_url":"https://api.github.com/repos/scriptotek/primo-services/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scriptotek/primo-services/downloads","issues_url":"https://api.github.com/repos/scriptotek/primo-services/issues{/number}","pulls_url":"https://api.github.com/repos/scriptotek/primo-services/pulls{/number}","milestones_url":"https://api.github.com/repos/scriptotek/primo-services/milestones{/number}","notifications_url":"https://api.github.com/repos/scriptotek/primo-services/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scriptotek/primo-services/labels{/name}","releases_url":"https://api.github.com/repos/scriptotek/primo-services/releases{/id}","created_at":"2014-08-22T12:52:20Z","updated_at":"2015-11-09T15:49:28Z","pushed_at":"2015-11-11T19:24:56Z","git_url":"git://github.com/scriptotek/primo-services.git","ssh_url":"git@github.com:scriptotek/primo-services.git","clone_url":"https://github.com/scriptotek/primo-services.git","svn_url":"https://github.com/scriptotek/primo-services","homepage":null,"size":544,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"BCLibraries:master","ref":"master","sha":"148b7ca8c7dbd270fc12e0ed8701b99af1f5e860","user":{"login":"BCLibraries","id":5758666,"avatar_url":"https://avatars.githubusercontent.com/u/5758666?v=3","gravatar_id":"","url":"https://api.github.com/users/BCLibraries","html_url":"https://github.com/BCLibraries","followers_url":"https://api.github.com/users/BCLibraries/followers","following_url":"https://api.github.com/users/BCLibraries/following{/other_user}","gists_url":"https://api.github.com/users/BCLibraries/gists{/gist_id}","starred_url":"https://api.github.com/users/BCLibraries/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BCLibraries/subscriptions","organizations_url":"https://api.github.com/users/BCLibraries/orgs","repos_url":"https://api.github.com/users/BCLibraries/repos","events_url":"https://api.github.com/users/BCLibraries/events{/privacy}","received_events_url":"https://api.github.com/users/BCLibraries/received_events","type":"Organization","site_admin":false},"repo":{"id":13873434,"name":"primo-services","full_name":"BCLibraries/primo-services","owner":{"login":"BCLibraries","id":5758666,"avatar_url":"https://avatars.githubusercontent.com/u/5758666?v=3","gravatar_id":"","url":"https://api.github.com/users/BCLibraries","html_url":"https://github.com/BCLibraries","followers_url":"https://api.github.com/users/BCLibraries/followers","following_url":"https://api.github.com/users/BCLibraries/following{/other_user}","gists_url":"https://api.github.com/users/BCLibraries/gists{/gist_id}","starred_url":"https://api.github.com/users/BCLibraries/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BCLibraries/subscriptions","organizations_url":"https://api.github.com/users/BCLibraries/orgs","repos_url":"https://api.github.com/users/BCLibraries/repos","events_url":"https://api.github.com/users/BCLibraries/events{/privacy}","received_events_url":"https://api.github.com/users/BCLibraries/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/BCLibraries/primo-services","description":"","fork":false,"url":"https://api.github.com/repos/BCLibraries/primo-services","forks_url":"https://api.github.com/repos/BCLibraries/primo-services/forks","keys_url":"https://api.github.com/repos/BCLibraries/primo-services/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BCLibraries/primo-services/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BCLibraries/primo-services/teams","hooks_url":"https://api.github.com/repos/BCLibraries/primo-services/hooks","issue_events_url":"https://api.github.com/repos/BCLibraries/primo-services/issues/events{/number}","events_url":"https://api.github.com/repos/BCLibraries/primo-services/events","assignees_url":"https://api.github.com/repos/BCLibraries/primo-services/assignees{/user}","branches_url":"https://api.github.com/repos/BCLibraries/primo-services/branches{/branch}","tags_url":"https://api.github.com/repos/BCLibraries/primo-services/tags","blobs_url":"https://api.github.com/repos/BCLibraries/primo-services/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BCLibraries/primo-services/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BCLibraries/primo-services/git/refs{/sha}","trees_url":"https://api.github.com/repos/BCLibraries/primo-services/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BCLibraries/primo-services/statuses/{sha}","languages_url":"https://api.github.com/repos/BCLibraries/primo-services/languages","stargazers_url":"https://api.github.com/repos/BCLibraries/primo-services/stargazers","contributors_url":"https://api.github.com/repos/BCLibraries/primo-services/contributors","subscribers_url":"https://api.github.com/repos/BCLibraries/primo-services/subscribers","subscription_url":"https://api.github.com/repos/BCLibraries/primo-services/subscription","commits_url":"https://api.github.com/repos/BCLibraries/primo-services/commits{/sha}","git_commits_url":"https://api.github.com/repos/BCLibraries/primo-services/git/commits{/sha}","comments_url":"https://api.github.com/repos/BCLibraries/primo-services/comments{/number}","issue_comment_url":"https://api.github.com/repos/BCLibraries/primo-services/issues/comments{/number}","contents_url":"https://api.github.com/repos/BCLibraries/primo-services/contents/{+path}","compare_url":"https://api.github.com/repos/BCLibraries/primo-services/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BCLibraries/primo-services/merges","archive_url":"https://api.github.com/repos/BCLibraries/primo-services/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BCLibraries/primo-services/downloads","issues_url":"https://api.github.com/repos/BCLibraries/primo-services/issues{/number}","pulls_url":"https://api.github.com/repos/BCLibraries/primo-services/pulls{/number}","milestones_url":"https://api.github.com/repos/BCLibraries/primo-services/milestones{/number}","notifications_url":"https://api.github.com/repos/BCLibraries/primo-services/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BCLibraries/primo-services/labels{/name}","releases_url":"https://api.github.com/repos/BCLibraries/primo-services/releases{/id}","created_at":"2013-10-25T22:17:55Z","updated_at":"2015-09-02T05:55:18Z","pushed_at":"2015-11-12T15:20:10Z","git_url":"git://github.com/BCLibraries/primo-services.git","ssh_url":"git@github.com:BCLibraries/primo-services.git","clone_url":"https://github.com/BCLibraries/primo-services.git","svn_url":"https://github.com/BCLibraries/primo-services","homepage":null,"size":477,"stargazers_count":4,"watchers_count":4,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":4,"forks":2,"open_issues":4,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/BCLibraries/primo-services/pulls/15"},"html":{"href":"https://github.com/BCLibraries/primo-services/pull/15"},"issue":{"href":"https://api.github.com/repos/BCLibraries/primo-services/issues/15"},"comments":{"href":"https://api.github.com/repos/BCLibraries/primo-services/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/BCLibraries/primo-services/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/BCLibraries/primo-services/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/BCLibraries/primo-services/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/BCLibraries/primo-services/statuses/0808d84f5ba85de48c20d3a75009aa267dd8b13a"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"Otterfan","id":210404,"avatar_url":"https://avatars.githubusercontent.com/u/210404?v=3","gravatar_id":"","url":"https://api.github.com/users/Otterfan","html_url":"https://github.com/Otterfan","followers_url":"https://api.github.com/users/Otterfan/followers","following_url":"https://api.github.com/users/Otterfan/following{/other_user}","gists_url":"https://api.github.com/users/Otterfan/gists{/gist_id}","starred_url":"https://api.github.com/users/Otterfan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Otterfan/subscriptions","organizations_url":"https://api.github.com/users/Otterfan/orgs","repos_url":"https://api.github.com/users/Otterfan/repos","events_url":"https://api.github.com/users/Otterfan/events{/privacy}","received_events_url":"https://api.github.com/users/Otterfan/received_events","type":"User","site_admin":false},"comments":1,"review_comments":0,"commits":1,"additions":7,"deletions":5,"changed_files":2}}