Skip to content

Commit

Permalink
new api subdomains
Browse files Browse the repository at this point in the history
  • Loading branch information
justincy committed Dec 12, 2017
1 parent dcf335d commit 5c503a3
Show file tree
Hide file tree
Showing 17 changed files with 375 additions and 361 deletions.
4 changes: 2 additions & 2 deletions src/FamilySearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -571,11 +571,11 @@ private function platformHost()
{
switch ($this->environment) {
case 'production':
return 'https://familysearch.org';
return 'https://api.familysearch.org';
case 'beta':
return 'https://beta.familysearch.org';
default:
return 'https://integration.familysearch.org';
return 'https://api-integ.familysearch.org';
}
}

Expand Down
4 changes: 2 additions & 2 deletions test/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ public function testRedirect()
$this->assertResponseOK($this->login());
$response = $this->client->get('/platform/tree/current-person');
$this->assertTrue($response->redirected);
$this->assertEquals('https://integration.familysearch.org/platform/tree/current-person', $response->originalUrl);
$this->assertEquals('https://integration.familysearch.org/platform/tree/persons/KW7G-28J', $response->effectiveUrl);
$this->assertEquals('https://api-integ.familysearch.org/platform/tree/current-person', $response->originalUrl);
$this->assertEquals('https://api-integ.familysearch.org/platform/tree/persons/KW7G-28J', $response->effectiveUrl);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions test/GedcomxPHPTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ public function testRedirect()
$this->assertResponseOK($this->login());
$response = $this->client->get('/platform/tree/current-person');
$this->assertTrue($response->redirected);
$this->assertEquals('https://integration.familysearch.org/platform/tree/current-person', $response->originalUrl);
$this->assertEquals('https://integration.familysearch.org/platform/tree/persons/KW7G-28J', $response->effectiveUrl);
$this->assertEquals('https://api-integ.familysearch.org/platform/tree/current-person', $response->originalUrl);
$this->assertEquals('https://api-integ.familysearch.org/platform/tree/persons/KW7G-28J', $response->effectiveUrl);
$this->assertHasGedcomxObject($response);
}

Expand Down
9 changes: 5 additions & 4 deletions test/fixtures/gedcomx/testAuthenticate.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"url": "https:\/\/integration.familysearch.org\/cis-web\/oauth2\/v3\/token",
"headers": {
"Host": "integration.familysearch.org",
"Content-Type": "application\/x-www-form-urlencoded"
"Content-Type": "application\/x-www-form-urlencoded",
"User-Agent": "FS-PHP-Lite\/1.2.0 curl\/7.35.0 PHP\/5.5.9-1ubuntu4.17"
},
"body": "grant_type=password&client_id=a02j000000CBv4gAAD&username=sdktester&password=1234sdkpass"
},
Expand All @@ -17,15 +18,15 @@
"headers": {
"Server": "Apache-Coyote\/1.1",
"Expires": "Tue, 03 Jul 2001 06:00:00 GMT",
"Last-Modified": "Tue Nov 01 21:16:49 GMT+00:00 2016",
"Last-Modified": "Tue Dec 12 16:06:03 GMT 2017",
"Cache-Control": "no-store, no-cache, must-revalidate, max-age=0, post-check=0, pre-check=0",
"Pragma": "no-cache",
"Content-Type": "application\/json;charset=ISO-8859-1",
"Content-Language": "en-US",
"Content-Length": "185",
"Date": "Tue, 01 Nov 2016 21:16:49 GMT",
"Date": "Tue, 12 Dec 2017 16:06:02 GMT",
"Connection": "close"
},
"body": "{\"token\":\"USYS0E1149A85417F4F62C90881701027042_idses-int02.a.fsglobal.net\",\"token_type\":\"family_search\",\"access_token\":\"USYS0E1149A85417F4F62C90881701027042_idses-int02.a.fsglobal.net\"}"
"body": "{\"access_token\":\"USYSE288BB69C35C579AD8028B512F645ACB_idses-int02.a.fsglobal.net\",\"token_type\":\"family_search\",\"token\":\"USYSE288BB69C35C579AD8028B512F645ACB_idses-int02.a.fsglobal.net\"}"
}
}]
82 changes: 42 additions & 40 deletions test/fixtures/gedcomx/testDelete.json

Large diffs are not rendered by default.

64 changes: 32 additions & 32 deletions test/fixtures/gedcomx/testGet.json

Large diffs are not rendered by default.

60 changes: 30 additions & 30 deletions test/fixtures/gedcomx/testHead.json

Large diffs are not rendered by default.

40 changes: 21 additions & 19 deletions test/fixtures/gedcomx/testPost.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"url": "https:\/\/integration.familysearch.org\/cis-web\/oauth2\/v3\/token",
"headers": {
"Host": "integration.familysearch.org",
"Content-Type": "application\/x-www-form-urlencoded"
"Content-Type": "application\/x-www-form-urlencoded",
"User-Agent": "FS-PHP-Lite\/1.2.0 curl\/7.35.0 PHP\/5.5.9-1ubuntu4.17"
},
"body": "grant_type=password&client_id=a02j000000CBv4gAAD&username=sdktester&password=1234sdkpass"
},
Expand All @@ -17,51 +18,52 @@
"headers": {
"Server": "Apache-Coyote\/1.1",
"Expires": "Tue, 03 Jul 2001 06:00:00 GMT",
"Last-Modified": "Tue Nov 01 21:16:08 GMT+00:00 2016",
"Last-Modified": "Tue Dec 12 16:06:03 GMT 2017",
"Cache-Control": "no-store, no-cache, must-revalidate, max-age=0, post-check=0, pre-check=0",
"Pragma": "no-cache",
"Content-Type": "application\/json;charset=ISO-8859-1",
"Content-Language": "en-US",
"Content-Length": "185",
"Date": "Tue, 01 Nov 2016 21:16:08 GMT",
"Date": "Tue, 12 Dec 2017 16:06:03 GMT",
"Connection": "close"
},
"body": "{\"token\":\"USYSF4D72D2069E4A5ACF983ECDAABC1DCAA_idses-int01.a.fsglobal.net\",\"token_type\":\"family_search\",\"access_token\":\"USYSF4D72D2069E4A5ACF983ECDAABC1DCAA_idses-int01.a.fsglobal.net\"}"
"body": "{\"access_token\":\"USYS2D8107A01EEC4662E912A26EC9F39667_idses-int01.a.fsglobal.net\",\"token_type\":\"family_search\",\"token\":\"USYS2D8107A01EEC4662E912A26EC9F39667_idses-int01.a.fsglobal.net\"}"
}
},{
"request": {
"method": "POST",
"url": "https:\/\/integration.familysearch.org\/platform\/tree\/persons",
"url": "https:\/\/api-integ.familysearch.org\/platform\/tree\/persons",
"headers": {
"Host": "integration.familysearch.org",
"Authorization": "Bearer USYSF4D72D2069E4A5ACF983ECDAABC1DCAA_idses-int01.a.fsglobal.net",
"Host": "api-integ.familysearch.org",
"Authorization": "Bearer USYS2D8107A01EEC4662E912A26EC9F39667_idses-int01.a.fsglobal.net",
"Accept": "application\/x-fs-v1+json",
"User-Agent": "FS-PHP-Lite\/1.2.0 curl\/7.35.0 PHP\/5.5.9-1ubuntu4.17",
"Content-Type": "application\/x-fs-v1+json"
},
"body": "{\"persons\":[{\"sources\":[{\"id\":\"34077598-142f-4784-b1e7-329e2b5a0625\",\"links\":{\"description\":{\"rel\":\"description\",\"href\":\"https:\\\/\\\/sandbox.familysearch.org\\\/platform\\\/sources\\\/descriptions\\\/MMZJ-GMV\"},\"source-reference\":{\"rel\":\"source-reference\",\"href\":\"https:\\\/\\\/sandbox.familysearch.org\\\/platform\\\/tree\\\/persons\\\/L5C2-WYC\\\/source-references\\\/34077598-142f-4784-b1e7-329e2b5a0625\"}},\"description\":\"https:\\\/\\\/sandbox.familysearch.org\\\/platform\\\/sources\\\/descriptions\\\/MMZJ-GMV\",\"attribution\":{\"contributor\":{\"resourceId\":\"MMDZ-8G7\",\"resource\":\"https:\\\/\\\/sandbox.familysearch.org\\\/platform\\\/users\\\/agents\\\/MMDZ-8G7\"},\"modified\":1470770475882}},{\"id\":\"c290dcce-f7eb-447b-8122-c03ae16f9b96\",\"links\":{\"description\":{\"rel\":\"description\",\"href\":\"https:\\\/\\\/sandbox.familysearch.org\\\/platform\\\/sources\\\/descriptions\\\/MMZJ-GMN\"},\"source-reference\":{\"rel\":\"source-reference\",\"href\":\"https:\\\/\\\/sandbox.familysearch.org\\\/platform\\\/tree\\\/persons\\\/L5C2-WYC\\\/source-references\\\/c290dcce-f7eb-447b-8122-c03ae16f9b96\"}},\"description\":\"https:\\\/\\\/sandbox.familysearch.org\\\/platform\\\/sources\\\/descriptions\\\/MMZJ-GMN\",\"attribution\":{\"contributor\":{\"resourceId\":\"MMDZ-8G7\",\"resource\":\"https:\\\/\\\/sandbox.familysearch.org\\\/platform\\\/users\\\/agents\\\/MMDZ-8G7\"},\"modified\":1470770441164}}],\"identifiers\":{\"http:\\\/\\\/gedcomx.org\\\/Persistent\":[\"https:\\\/\\\/sandbox.familysearch.org\\\/ark:\\\/61903\\\/4:1:L5C2-WYC\"]},\"living\":false,\"gender\":{\"id\":\"8b165ed0-5377-4c55-b4c5-1d6407166e3f\",\"links\":{\"conclusion\":{\"rel\":\"conclusion\",\"href\":\"https:\\\/\\\/sandbox.familysearch.org\\\/platform\\\/tree\\\/persons\\\/L5C2-WYC\\\/conclusions\\\/8b165ed0-5377-4c55-b4c5-1d6407166e3f\"}},\"attribution\":{\"contributor\":{\"resourceId\":\"MMFW-HTT\",\"resource\":\"https:\\\/\\\/sandbox.familysearch.org\\\/platform\\\/users\\\/agents\\\/MMFW-HTT\"},\"modified\":1467250315751},\"type\":\"http:\\\/\\\/gedcomx.org\\\/Male\"},\"names\":[{\"id\":\"54910b54-274d-461c-adda-7190479bc4c7\",\"links\":{\"conclusion\":{\"rel\":\"conclusion\",\"href\":\"https:\\\/\\\/sandbox.familysearch.org\\\/platform\\\/tree\\\/persons\\\/L5C2-WYC\\\/conclusions\\\/54910b54-274d-461c-adda-7190479bc4c7\"}},\"attribution\":{\"contributor\":{\"resourceId\":\"MMFW-HTT\",\"resource\":\"https:\\\/\\\/sandbox.familysearch.org\\\/platform\\\/users\\\/agents\\\/MMFW-HTT\"},\"modified\":1467250315751},\"type\":\"http:\\\/\\\/gedcomx.org\\\/BirthName\",\"preferred\":true,\"nameForms\":[{\"fullText\":\"Ebenezer Clark\",\"parts\":[{\"value\":\"Ebenezer\",\"type\":\"http:\\\/\\\/gedcomx.org\\\/Given\"},{\"value\":\"Clark\",\"type\":\"http:\\\/\\\/gedcomx.org\\\/Surname\"}]}]}],\"facts\":[{\"id\":\"99519cb9-a8bf-4914-9f11-ccf93492b48b\",\"links\":{\"conclusion\":{\"rel\":\"conclusion\",\"href\":\"https:\\\/\\\/sandbox.familysearch.org\\\/platform\\\/tree\\\/persons\\\/L5C2-WYC\\\/conclusions\\\/99519cb9-a8bf-4914-9f11-ccf93492b48b\"}},\"attribution\":{\"contributor\":{\"resourceId\":\"MMFW-HTT\",\"resource\":\"https:\\\/\\\/sandbox.familysearch.org\\\/platform\\\/users\\\/agents\\\/MMFW-HTT\"},\"modified\":1467250315751},\"type\":\"http:\\\/\\\/gedcomx.org\\\/Birth\",\"date\":{\"original\":\"29 Nov 1651\",\"formal\":\"+1651-11-29\",\"normalized\":[{\"lang\":\"en-US\",\"value\":\"29 November 1651\"},{\"value\":\"29 November 1651\"}]},\"place\":{\"description\":\"#1740247784\",\"original\":\"NEW HAVEN,NEW HAVEN,CONN\",\"normalized\":[{\"lang\":\"en-US\",\"value\":\"New Haven, New Haven, Connecticut, United States\"},{\"value\":\"New Haven, New Haven, Connecticut, United States\"},{\"value\":\"New Haven, New Haven, Connecticut, United States\"}]}},{\"id\":\"8e9dd699-4cea-4d30-8ff2-d5d11b171937\",\"links\":{\"conclusion\":{\"rel\":\"conclusion\",\"href\":\"https:\\\/\\\/sandbox.familysearch.org\\\/platform\\\/tree\\\/persons\\\/L5C2-WYC\\\/conclusions\\\/8e9dd699-4cea-4d30-8ff2-d5d11b171937\"}},\"attribution\":{\"contributor\":{\"resourceId\":\"MMFW-HTT\",\"resource\":\"https:\\\/\\\/sandbox.familysearch.org\\\/platform\\\/users\\\/agents\\\/MMFW-HTT\"},\"modified\":1467250315751},\"type\":\"http:\\\/\\\/gedcomx.org\\\/Death\",\"date\":{\"original\":\"1721\",\"formal\":\"+1721\",\"normalized\":[{\"lang\":\"en-US\",\"value\":\"1721\"},{\"value\":\"1721\"}]},\"place\":{\"description\":\"#1243627151\",\"original\":\"WALLINGFORD,NEW HAVEN CONN.\",\"normalized\":[{\"lang\":\"en-US\",\"value\":\"Wallingford, New Haven, Connecticut, United States\"},{\"value\":\"Wallingford, New Haven, Connecticut, United States\"},{\"value\":\"Wallingford, New Haven, Connecticut, United States\"}]}},{\"id\":\"80c2512c-d2bc-422c-a0b8-66fb4621c2f7\",\"links\":{\"conclusion\":{\"rel\":\"conclusion\",\"href\":\"https:\\\/\\\/sandbox.familysearch.org\\\/platform\\\/tree\\\/persons\\\/L5C2-WYC\\\/conclusions\\\/80c2512c-d2bc-422c-a0b8-66fb4621c2f7\"}},\"attribution\":{\"contributor\":{\"resourceId\":\"MMFW-HTT\",\"resource\":\"https:\\\/\\\/sandbox.familysearch.org\\\/platform\\\/users\\\/agents\\\/MMFW-HTT\"},\"modified\":1467250315751},\"type\":\"http:\\\/\\\/gedcomx.org\\\/Burial\",\"date\":{\"original\":\"1721\",\"formal\":\"+1721\",\"normalized\":[{\"lang\":\"en-US\",\"value\":\"1721\"},{\"value\":\"1721\"}]},\"place\":{\"description\":\"#1243627151\",\"original\":\"WALLINGFORD,NEW HAVEN CONN.\",\"normalized\":[{\"lang\":\"en-US\",\"value\":\"Wallingford, New Haven, Connecticut, United States\"},{\"value\":\"Wallingford, New Haven, Connecticut, United States\"},{\"value\":\"Wallingford, New Haven, Connecticut, United States\"}]}},{\"id\":\"c36105fd-4502-4a35-867c-308623e24299\",\"links\":{\"conclusion\":{\"rel\":\"conclusion\",\"href\":\"https:\\\/\\\/sandbox.familysearch.org\\\/platform\\\/tree\\\/persons\\\/L5C2-WYC\\\/conclusions\\\/c36105fd-4502-4a35-867c-308623e24299\"}},\"attribution\":{\"contributor\":{\"resourceId\":\"MMFW-HTT\",\"resource\":\"https:\\\/\\\/sandbox.familysearch.org\\\/platform\\\/users\\\/agents\\\/MMFW-HTT\"},\"modified\":1467250315751},\"type\":\"http:\\\/\\\/gedcomx.org\\\/Christening\",\"date\":{\"original\":\"29 Nov 1651\",\"formal\":\"+1651-11-29\",\"normalized\":[{\"lang\":\"en-US\",\"value\":\"29 November 1651\"},{\"value\":\"29 November 1651\"}]},\"place\":{\"description\":\"#1740247784\",\"original\":\"NEW HAVEN,NEW HAVEN,CONN\",\"normalized\":[{\"lang\":\"en-US\",\"value\":\"New Haven, New Haven, Connecticut, United States\"},{\"value\":\"New Haven, New Haven, Connecticut, United States\"},{\"value\":\"New Haven, New Haven, Connecticut, United States\"}]}}]}],\"sourceDescriptions\":[{\"id\":\"SD-L5C2-WYC\",\"links\":{\"description\":{\"rel\":\"description\",\"href\":\"https:\\\/\\\/sandbox.familysearch.org\\\/platform\\\/sources\\\/descriptions\\\/SD-L5C2-WYC\"}},\"about\":\"#L5C2-WYC\",\"resourceType\":\"http:\\\/\\\/gedcomx.org\\\/Person\",\"citations\":[{\"lang\":\"en\",\"value\":\"\\\"Family Tree,\\\" database, <i>FamilySearch<\\\/i> (http:\\\/\\\/familysearch.org : modified 09 August 2016, 19:21), entry for Ebenezer Clark(PID https:\\\/\\\/sandbox.familysearch.org\\\/ark:\\\/61903\\\/4:1:L5C2-WYC); contributed by various users.\"}],\"componentOf\":{\"description\":\"https:\\\/\\\/sandbox.familysearch.org\\\/platform\\\/collections\\\/tree\"},\"titles\":[{\"value\":\"Ebenezer Clark\"}],\"identifiers\":{\"http:\\\/\\\/gedcomx.org\\\/Persistent\":[\"https:\\\/\\\/sandbox.familysearch.org\\\/ark:\\\/61903\\\/4:1:L5C2-WYC\"]},\"modified\":1470770475000}]}"
},
"response": {
"status": {
"http_version": "1.1",
"code": "201",
"message": "Created"
"code": "404",
"message": "Not Found"
},
"headers": {
"Cache-Control": "no-cache, no-store, no-transform, must-revalidate, max-age=0",
"Content-Type": "application\/x-fs-v1+json",
"Date": "Tue, 01 Nov 2016 21:15:21 GMT",
"Link": "<https:\/\/integration.familysearch.org\/platform\/tree\/ancestry?person=L58X-Y39>; rel=\"ancestry\", <https:\/\/integration.familysearch.org\/platform\/tree\/persons\/L58X-Y39\/child-relationships>; rel=\"child-relationships\", <https:\/\/integration.familysearch.org\/platform\/tree\/descendancy?person=L58X-Y39>; rel=\"descendancy\", <https:\/\/integration.familysearch.org\/platform\/tree\/persons\/L58X-Y39\/discussion-references>; rel=\"discussion-references\", <https:\/\/integration.familysearch.org\/platform\/tree\/persons\/L58X-Y39\/matches>; rel=\"matches\", <https:\/\/integration.familysearch.org\/platform\/tree\/persons\/L58X-Y39\/notes>; rel=\"notes\", <https:\/\/integration.familysearch.org\/platform\/tree\/persons\/L58X-Y39\/parent-relationships>; rel=\"parent-relationships\", <https:\/\/integration.familysearch.org\/platform\/tree\/persons-with-relationships?person=L58X-Y39>; rel=\"person-with-relationships\", <https:\/\/integration.familysearch.org\/platform\/tree\/persons>; rel=\"persons\", <https:\/\/integration.familysearch.org\/platform\/tree\/persons\/L58X-Y39\/source-references>; rel=\"source-references\", <https:\/\/integration.familysearch.org\/platform\/tree\/persons\/L58X-Y39\/spouse-relationships>; rel=\"spouse-relationships\"",
"Location": "https:\/\/integration.familysearch.org\/platform\/tree\/persons\/L58X-Y39",
"Date": "Tue, 12 Dec 2017 16:06:04 GMT",
"Link": "<https:\/\/api-integ.familysearch.org\/platform\/tree\/ancestry?person=L5F4-S1L>; rel=\"ancestry\", <https:\/\/api-integ.familysearch.org\/platform\/tree\/persons\/L5F4-S1L\/child-relationships>; rel=\"child-relationships\", <https:\/\/api-integ.familysearch.org\/platform\/tree\/descendancy?person=L5F4-S1L>; rel=\"descendancy\", <https:\/\/api-integ.familysearch.org\/platform\/tree\/persons\/L5F4-S1L\/discussion-references>; rel=\"discussion-references\", <https:\/\/api-integ.familysearch.org\/platform\/tree\/persons\/L5F4-S1L\/matches>; rel=\"matches\", <https:\/\/api-integ.familysearch.org\/platform\/tree\/persons\/L5F4-S1L\/notes>; rel=\"notes\", <https:\/\/api-integ.familysearch.org\/platform\/tree\/persons\/L5F4-S1L\/parent-relationships>; rel=\"parent-relationships\", <https:\/\/api-integ.familysearch.org\/platform\/tree\/persons>; rel=\"persons\", <https:\/\/api-integ.familysearch.org\/platform\/tree\/persons\/L5F4-S1L\/source-references>; rel=\"source-references\", <https:\/\/api-integ.familysearch.org\/platform\/tree\/persons\/L5F4-S1L\/spouse-relationships>; rel=\"spouse-relationships\"",
"Location": "https:\/\/api-integ.familysearch.org\/platform\/tree\/persons\/L5F4-S1L",
"Server": "Apache-Coyote\/1.1",
"Vary": "Accept, Accept-Language, Accept-Encoding, Expect, Accept-Encoding",
"Warning": "400 FamilySearch \"A locale was specified for normalized date 29 November 1651 but it will be ignored.\", 400 FamilySearch \"Multiple normalized date values were provided. Only the first will be accepted.\", 400 FamilySearch \"A locale was specified for normalized date 1721 but it will be ignored.\", 400 FamilySearch \"Multiple normalized date values were provided. Only the first will be accepted.\", 400 FamilySearch \"A locale was specified for normalized date 1721 but it will be ignored.\", 400 FamilySearch \"Multiple normalized date values were provided. Only the first will be accepted.\", 400 FamilySearch \"A locale was specified for normalized date 29 November 1651 but it will be ignored.\", 400 FamilySearch \"Multiple normalized date values were provided. Only the first will be accepted.\"",
"X-ENTITY-ID": "L58X-Y39",
"X-PROCESSING-TIME": "1176",
"X-THROTTLE-MILLIS-LEFT": "1797433",
"X-THROTTLE-MILLIS-USED": "2567",
"X-THROTTLE-WINDOW-SIZE": "1800000",
"Warning": "400 FamilySearch \"Unable to read place reference #1243627151 (null).\", 400 FamilySearch \"Unable to read place reference #1740247784 (null).\", 400 FamilySearch \"Unable to read place reference #1740247784 (null).\", 400 FamilySearch \"Unable to read place reference #1243627151 (null).\", 400 FamilySearch \"Multiple normalized date values were provided. Only the first will be accepted.\", 400 FamilySearch \"Multiple normalized date values were provided. Only the first will be accepted.\", 400 FamilySearch \"Multiple normalized date values were provided. Only the first will be accepted.\", 400 FamilySearch \"Multiple normalized date values were provided. Only the first will be accepted.\"",
"X-ENTITY-ID": "L5F4-S1L",
"X-PROCESSING-TIME": "310",
"X-THROTTLE-MILLIS-LEFT": "55137",
"X-THROTTLE-MILLIS-USED": "4863",
"X-THROTTLE-WINDOW-SIZE": "60000",
"Content-Length": "0",
"Connection": "Close"
"Connection": "keep-alive"
}
}
}]
Loading

0 comments on commit 5c503a3

Please sign in to comment.