Giffgaff_eSIM.json 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605
  1. {
  2. "info": {
  3. "_postman_id": "3c9f96d5-1cf8-4e11-b5ec-adfbbb2ba17a",
  4. "name": "Giffgaff转eSIM",
  5. "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
  6. "_exporter_id": "5019143"
  7. },
  8. "item": [
  9. {
  10. "name": "1.发送认证邮件 Send Email Verification",
  11. "event": [
  12. {
  13. "listen": "test",
  14. "script": {
  15. "exec": [
  16. "pm.collectionVariables.set(\"email_code_ref\", pm.response.json().ref);"
  17. ],
  18. "type": "text/javascript"
  19. }
  20. }
  21. ],
  22. "request": {
  23. "method": "POST",
  24. "header": [],
  25. "body": {
  26. "mode": "raw",
  27. "raw": "{\r\n\t\"source\": \"esim\",\r\n\t\"preferredChannels\": [\"EMAIL\"]\r\n}",
  28. "options": {
  29. "raw": {
  30. "language": "json"
  31. }
  32. }
  33. },
  34. "url": {
  35. "raw": "https://id.giffgaff.com/v4/mfa/challenge/me",
  36. "protocol": "https",
  37. "host": [
  38. "id",
  39. "giffgaff",
  40. "com"
  41. ],
  42. "path": [
  43. "v4",
  44. "mfa",
  45. "challenge",
  46. "me"
  47. ]
  48. }
  49. },
  50. "response": []
  51. },
  52. {
  53. "name": "2.输入邮件验证码 Verify Email code",
  54. "event": [
  55. {
  56. "listen": "test",
  57. "script": {
  58. "exec": [
  59. "pm.collectionVariables.set(\"email_signature\", pm.response.json().signature);"
  60. ],
  61. "type": "text/javascript"
  62. }
  63. },
  64. {
  65. "listen": "prerequest",
  66. "script": {
  67. "exec": [
  68. "pm.collectionVariables.set(\"email_code\", pm.request.url.query.get(\"code\"));"
  69. ],
  70. "type": "text/javascript"
  71. }
  72. }
  73. ],
  74. "request": {
  75. "method": "POST",
  76. "header": [],
  77. "body": {
  78. "mode": "raw",
  79. "raw": "{\r\n\t\"ref\": \"{{email_code_ref}}\",\r\n\t\"code\": \"{{email_code}}\"\r\n}",
  80. "options": {
  81. "raw": {
  82. "language": "json"
  83. }
  84. }
  85. },
  86. "url": {
  87. "raw": "https://id.giffgaff.com/v4/mfa/validation?code=159804",
  88. "protocol": "https",
  89. "host": [
  90. "id",
  91. "giffgaff",
  92. "com"
  93. ],
  94. "path": [
  95. "v4",
  96. "mfa",
  97. "validation"
  98. ],
  99. "query": [
  100. {
  101. "key": "code",
  102. "value": "159804"
  103. }
  104. ]
  105. }
  106. },
  107. "response": []
  108. },
  109. {
  110. "name": "3.获取会员ID Get MemberID",
  111. "event": [
  112. {
  113. "listen": "test",
  114. "script": {
  115. "exec": [
  116. "pm.collectionVariables.set(\"memberId\", pm.response.json().data.memberProfile.id);\r",
  117. ""
  118. ],
  119. "type": "text/javascript"
  120. }
  121. },
  122. {
  123. "listen": "prerequest",
  124. "script": {
  125. "exec": [
  126. "console.log(pm.collectionVariables.get(\"email_signature\"))\r",
  127. "if(pm.collectionVariables.get(\"email_signature\")==null || pm.collectionVariables.get(\"email_signature\")== \"\"){\r",
  128. " console.error(\"Email 尚未验证\");\r",
  129. " throw new Error(\"Email 尚未验证\");\r",
  130. "}"
  131. ],
  132. "type": "text/javascript"
  133. }
  134. }
  135. ],
  136. "request": {
  137. "method": "POST",
  138. "header": [],
  139. "body": {
  140. "mode": "graphql",
  141. "graphql": {
  142. "query": "query getMemberProfileAndSim {\r\n memberProfile {\r\n id\r\n memberName\r\n __typename\r\n }\r\n sim {\r\n phoneNumber\r\n status\r\n __typename\r\n }\r\n}\r\n",
  143. "variables": ""
  144. }
  145. },
  146. "url": {
  147. "raw": "https://publicapi.giffgaff.com/gateway/graphql",
  148. "protocol": "https",
  149. "host": [
  150. "publicapi",
  151. "giffgaff",
  152. "com"
  153. ],
  154. "path": [
  155. "gateway",
  156. "graphql"
  157. ]
  158. }
  159. },
  160. "response": []
  161. },
  162. {
  163. "name": "4.预订eSIM Reserve eSIM",
  164. "event": [
  165. {
  166. "listen": "test",
  167. "script": {
  168. "exec": [
  169. "pm.collectionVariables.set(\"esim_ssn\", pm.response.json().data.reserveESim.esim.ssn);\r",
  170. "pm.collectionVariables.set(\"esim_activation_code\", pm.response.json().data.reserveESim.esim.activationCode);\r",
  171. ""
  172. ],
  173. "type": "text/javascript"
  174. }
  175. }
  176. ],
  177. "request": {
  178. "method": "POST",
  179. "header": [
  180. {
  181. "key": "x-gg-app-os",
  182. "value": "iOS",
  183. "type": "text"
  184. },
  185. {
  186. "key": "x-gg-app-os-version",
  187. "value": "14",
  188. "type": "text"
  189. },
  190. {
  191. "key": "x-gg-app-build-number",
  192. "value": "722",
  193. "type": "text"
  194. },
  195. {
  196. "key": "x-gg-app-device-manufacturer",
  197. "value": "apple",
  198. "type": "text"
  199. },
  200. {
  201. "key": "x-gg-app-device-model",
  202. "value": "iphone15",
  203. "type": "text"
  204. },
  205. {
  206. "key": "x-gg-app-version",
  207. "value": "13.21.2",
  208. "type": "text"
  209. }
  210. ],
  211. "body": {
  212. "mode": "graphql",
  213. "graphql": {
  214. "query": "mutation reserveESim($input: ESimReservationInput!) {\r\n reserveESim: reserveESim(input: $input) {\r\n id\r\n memberId\r\n reservationStartDate\r\n reservationEndDate\r\n status\r\n esim {\r\n ssn\r\n activationCode\r\n deliveryStatus\r\n associatedMemberId\r\n __typename\r\n }\r\n __typename\r\n }\r\n}\r\n",
  215. "variables": "{\r\n \"input\": {\r\n\t\t\"memberId\": \"{{memberId}}\",\r\n\t\t\"userIntent\": \"SWITCH\"\r\n\t}\r\n}"
  216. }
  217. },
  218. "url": {
  219. "raw": "https://publicapi.giffgaff.com/gateway/graphql",
  220. "protocol": "https",
  221. "host": [
  222. "publicapi",
  223. "giffgaff",
  224. "com"
  225. ],
  226. "path": [
  227. "gateway",
  228. "graphql"
  229. ]
  230. }
  231. },
  232. "response": []
  233. },
  234. {
  235. "name": "5.执行交换eSIM Swap eSIM",
  236. "event": [
  237. {
  238. "listen": "test",
  239. "script": {
  240. "exec": [
  241. ""
  242. ],
  243. "type": "text/javascript"
  244. }
  245. },
  246. {
  247. "listen": "prerequest",
  248. "script": {
  249. "exec": [
  250. ""
  251. ],
  252. "type": "text/javascript"
  253. }
  254. }
  255. ],
  256. "request": {
  257. "method": "POST",
  258. "header": [
  259. {
  260. "key": "x-gg-app-os",
  261. "value": "iOS",
  262. "type": "text"
  263. },
  264. {
  265. "key": "x-gg-app-os-version",
  266. "value": "14",
  267. "type": "text"
  268. },
  269. {
  270. "key": "x-gg-app-build-number",
  271. "value": "722",
  272. "type": "text"
  273. },
  274. {
  275. "key": "x-gg-app-device-manufacturer",
  276. "value": "apple",
  277. "type": "text"
  278. },
  279. {
  280. "key": "x-gg-app-device-model",
  281. "value": "iphone15",
  282. "type": "text"
  283. },
  284. {
  285. "key": "x-gg-app-version",
  286. "value": "13.21.2",
  287. "type": "text"
  288. }
  289. ],
  290. "body": {
  291. "mode": "graphql",
  292. "graphql": {
  293. "query": "mutation SwapSim($activationCode: String!, $mfaSignature: String!) {\r\n swapSim(activationCode: $activationCode, mfaSignature: $mfaSignature) {\r\n old {\r\n ssn\r\n activationCode\r\n __typename\r\n }\r\n new {\r\n ssn\r\n activationCode\r\n __typename\r\n }\r\n __typename\r\n }\r\n}\r\n",
  294. "variables": "{\r\n\t\"activationCode\": \"{{esim_activation_code}}\",\r\n\t\"mfaSignature\": \"{{email_signature}}\"\r\n}"
  295. }
  296. },
  297. "url": {
  298. "raw": "https://publicapi.giffgaff.com/gateway/graphql",
  299. "protocol": "https",
  300. "host": [
  301. "publicapi",
  302. "giffgaff",
  303. "com"
  304. ],
  305. "path": [
  306. "gateway",
  307. "graphql"
  308. ]
  309. }
  310. },
  311. "response": []
  312. },
  313. {
  314. "name": "6.获取eSIM信息 Get eSIM",
  315. "request": {
  316. "method": "POST",
  317. "header": [
  318. {
  319. "key": "x-gg-app-os",
  320. "value": "iOS",
  321. "type": "text"
  322. },
  323. {
  324. "key": "x-gg-app-os-version",
  325. "value": "14",
  326. "type": "text"
  327. },
  328. {
  329. "key": "x-gg-app-build-number",
  330. "value": "722",
  331. "type": "text"
  332. },
  333. {
  334. "key": "x-gg-app-device-manufacturer",
  335. "value": "apple",
  336. "type": "text"
  337. },
  338. {
  339. "key": "x-gg-app-device-model",
  340. "value": "iphone15",
  341. "type": "text"
  342. },
  343. {
  344. "key": "x-gg-app-version",
  345. "value": "13.21.2",
  346. "type": "text"
  347. }
  348. ],
  349. "body": {
  350. "mode": "graphql",
  351. "graphql": {
  352. "query": "query getESims($deliveryStatus: ESimDeliveryStatus!) {\r\n eSims(deliveryStatus: $deliveryStatus) {\r\n ssn\r\n __typename\r\n }\r\n}\r\n",
  353. "variables": "{\r\n\t\"deliveryStatus\": \"DOWNLOADABLE\"\r\n}"
  354. }
  355. },
  356. "url": {
  357. "raw": "https://publicapi.giffgaff.com/gateway/graphql",
  358. "protocol": "https",
  359. "host": [
  360. "publicapi",
  361. "giffgaff",
  362. "com"
  363. ],
  364. "path": [
  365. "gateway",
  366. "graphql"
  367. ]
  368. }
  369. },
  370. "response": []
  371. },
  372. {
  373. "name": "7.获取eSIM下载码 Get eSIM Token",
  374. "event": [
  375. {
  376. "listen": "test",
  377. "script": {
  378. "exec": [
  379. "pm.collectionVariables.set(\"lpa_string\", pm.response.json().data.eSimDownloadToken.lpaString);"
  380. ],
  381. "type": "text/javascript"
  382. }
  383. }
  384. ],
  385. "request": {
  386. "method": "POST",
  387. "header": [
  388. {
  389. "key": "x-gg-app-os",
  390. "value": "iOS",
  391. "type": "text"
  392. },
  393. {
  394. "key": "x-gg-app-os-version",
  395. "value": "14",
  396. "type": "text"
  397. },
  398. {
  399. "key": "x-gg-app-build-number",
  400. "value": "722",
  401. "type": "text"
  402. },
  403. {
  404. "key": "x-gg-app-device-manufacturer",
  405. "value": "apple",
  406. "type": "text"
  407. },
  408. {
  409. "key": "x-gg-app-device-model",
  410. "value": "iphone15",
  411. "type": "text"
  412. },
  413. {
  414. "key": "x-gg-app-version",
  415. "value": "13.21.2",
  416. "type": "text"
  417. }
  418. ],
  419. "body": {
  420. "mode": "graphql",
  421. "graphql": {
  422. "query": "query eSimDownloadToken($ssn: String!) {\r\n eSimDownloadToken(ssn: $ssn) {\r\n id\r\n host\r\n matchingId\r\n lpaString\r\n __typename\r\n }\r\n}\r\n",
  423. "variables": "{\r\n\t\"ssn\": \"{{esim_ssn}}\"\r\n}"
  424. }
  425. },
  426. "url": {
  427. "raw": "https://publicapi.giffgaff.com/gateway/graphql",
  428. "protocol": "https",
  429. "host": [
  430. "publicapi",
  431. "giffgaff",
  432. "com"
  433. ],
  434. "path": [
  435. "gateway",
  436. "graphql"
  437. ]
  438. }
  439. },
  440. "response": []
  441. },
  442. {
  443. "name": "8.生成eSIM二维码 Get eSIM QRCode",
  444. "request": {
  445. "method": "GET",
  446. "header": [],
  447. "url": {
  448. "raw": "https://api.qrserver.com/v1/create-qr-code/?data={{lpa_string}}&size=200x200",
  449. "protocol": "https",
  450. "host": [
  451. "api",
  452. "qrserver",
  453. "com"
  454. ],
  455. "path": [
  456. "v1",
  457. "create-qr-code",
  458. ""
  459. ],
  460. "query": [
  461. {
  462. "key": "data",
  463. "value": "{{lpa_string}}"
  464. },
  465. {
  466. "key": "size",
  467. "value": "200x200"
  468. }
  469. ]
  470. }
  471. },
  472. "response": []
  473. }
  474. ],
  475. "auth": {
  476. "type": "oauth2",
  477. "oauth2": [
  478. {
  479. "key": "refreshRequestParams",
  480. "value": [],
  481. "type": "any"
  482. },
  483. {
  484. "key": "tokenRequestParams",
  485. "value": [],
  486. "type": "any"
  487. },
  488. {
  489. "key": "authRequestParams",
  490. "value": [],
  491. "type": "any"
  492. },
  493. {
  494. "key": "tokenName",
  495. "value": "Giffgaff",
  496. "type": "string"
  497. },
  498. {
  499. "key": "challengeAlgorithm",
  500. "value": "S256",
  501. "type": "string"
  502. },
  503. {
  504. "key": "state",
  505. "value": "cd34c1ef-f1c7-4d5c-8030-bf9753a2ccd5",
  506. "type": "string"
  507. },
  508. {
  509. "key": "scope",
  510. "value": "read",
  511. "type": "string"
  512. },
  513. {
  514. "key": "redirect_uri",
  515. "value": "giffgaff://auth/callback/",
  516. "type": "string"
  517. },
  518. {
  519. "key": "grant_type",
  520. "value": "authorization_code_with_pkce",
  521. "type": "string"
  522. },
  523. {
  524. "key": "clientSecret",
  525. "value": "OQv4cfiyol8TvCW4yiLGj0c1AkTR3N2JfRzq7XGqMxk=",
  526. "type": "string"
  527. },
  528. {
  529. "key": "clientId",
  530. "value": "4a05bf219b3985647d9b9a3ba610a9ce",
  531. "type": "string"
  532. },
  533. {
  534. "key": "authUrl",
  535. "value": "https://id.giffgaff.com/auth/oauth/authorize",
  536. "type": "string"
  537. },
  538. {
  539. "key": "addTokenTo",
  540. "value": "header",
  541. "type": "string"
  542. },
  543. {
  544. "key": "client_authentication",
  545. "value": "header",
  546. "type": "string"
  547. },
  548. {
  549. "key": "accessTokenUrl",
  550. "value": "https://id.giffgaff.com/auth/oauth/token",
  551. "type": "string"
  552. }
  553. ]
  554. },
  555. "event": [
  556. {
  557. "listen": "prerequest",
  558. "script": {
  559. "type": "text/javascript",
  560. "exec": [
  561. ""
  562. ]
  563. }
  564. },
  565. {
  566. "listen": "test",
  567. "script": {
  568. "type": "text/javascript",
  569. "exec": [
  570. ""
  571. ]
  572. }
  573. }
  574. ],
  575. "variable": [
  576. {
  577. "key": "memberId",
  578. "value": ""
  579. },
  580. {
  581. "key": "esim_ssn",
  582. "value": ""
  583. },
  584. {
  585. "key": "esim_activation_code",
  586. "value": ""
  587. },
  588. {
  589. "key": "email_code_ref",
  590. "value": ""
  591. },
  592. {
  593. "key": "email_signature",
  594. "value": ""
  595. },
  596. {
  597. "key": "lpa_string",
  598. "value": ""
  599. },
  600. {
  601. "key": "email_code",
  602. "value": ""
  603. }
  604. ]
  605. }