conoro

Example of Paginated API Handling in Tines

Oct 18th, 2021
758
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. {"agents":[{"disabled":false,"name":"Get 10 Stories","options":"{\"url\":\"https://{{ .RESOURCE.tines_domain }}/api/v1/stories?per_page=10\",\"content_type\":\"json\",\"method\":\"get\",\"headers\":{\"x-user-email\":\"{{ .RESOURCE.tines_api_email }}\",\"x-user-token\":\"{{ .CREDENTIAL.tines_user_token }}\"}}","position":{"x":-975,"y":45},"type":"httpRequest"},{"disabled":false,"name":"Has More Pages","options":"{\"rules\":[{\"type\":\"!regex\",\"path\":\"{{ .get_10_stories.body.meta.next_page }}\",\"value\":\"^$\"}]}","position":{"x":-900,"y":150},"type":"trigger"},{"disabled":false,"name":"Do Something For Each Page Here","options":"{\"mode\":\"message_only\",\"payload\":{\"message\":\"{{ .get_10_stories.body.stories | as_object }}\"}}","position":{"x":-975,"y":375},"type":"eventTransformation"},{"disabled":false,"name":"Get 10 Stories","options":"{\"url\":\"{{ .get_10_stories.body.meta.next_page }}\",\"content_type\":\"json\",\"method\":\"get\",\"headers\":{\"x-user-email\":\"{{ .RESOURCE.tines_api_email }}\",\"x-user-token\":\"{{ .CREDENTIAL.tines_user_token }}\"}}","position":{"x":-900,"y":255},"type":"httpRequest"}],"links":[{"sourceIdentifier":0,"receiverIdentifier":2},{"sourceIdentifier":1,"receiverIdentifier":3},{"sourceIdentifier":3,"receiverIdentifier":1},{"sourceIdentifier":0,"receiverIdentifier":1},{"sourceIdentifier":3,"receiverIdentifier":2}],"diagramNotes":[]}
RAW Paste Data