Guest User

Untitled

a guest
Dec 9th, 2017
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. **Single Sign On**
  2.  
  3. You can generate an SSO account by defining a integrator and identityToken
  4.  
  5. POST /v1/account/token
  6.  
  7. *Request Body*
  8.  
  9. {
  10. "integrator": `{$sendInBlue}`,
  11. "identityToken": `${userId}`
  12. }
  13.  
  14. *Example response*
  15.  
  16. {
  17. email: `${guid}@bannerwise.io`
  18. ...
  19. }
  20.  
  21. **Credentials**
  22.  
  23. You can generate credentials using the SSO response email value.
  24.  
  25. POST /v1/session
  26.  
  27. {
  28. username: response.email.split('@')[0],
  29. password: `${username}_${identityToken}`
  30. }
  31.  
  32. *Example response*
  33.  
  34. {
  35. token: {
  36. accessToken: 'c372d987709b4d1ab07566bf6f5a7c20bb97e622'
  37. ...
  38. }
  39. }
  40.  
  41. **Handling API requests**
  42.  
  43. Ones you have the access token you can the Authentication Bearer with every request. To get access to the API the **Authentication Bearer** has to be set in **every call**.
  44.  
  45. GET /v1/bannerset
  46.  
  47. {
  48. includePublic: true,
  49. limit: 20,
  50. skip: 0,
  51. type: 'template'
  52. }
  53.  
  54. Authentication Bearer
  55.  
  56. { Authorization: `Bearer ${localStorage.getItem('accessToken')}`
Add Comment
Please, Sign In to add comment