Demandes Opticreche Vallet (Retrieve poll every 2 minutes)
@jeremy
code:
data:privatelast updated:5 years agoarchived
today
Build integrations remarkably fast!
You're viewing a public workflow template.
Sign up to customize, add steps, modify code and more.
Join 1,000,000+ developers using the Pipedream platform
steps.
trigger
Cron Scheduler
Deploy to configure a custom schedule
This workflow runs on Pipedream's servers and is triggered on a custom schedule.
steps.
nodejs
auth
to use OAuth tokens and API keys in code via theauths object
code
Write any Node.jscodeand use anynpm package. You can alsoexport datafor use in later steps via return or this.key = 'value', pass input data to your code viaparams, and maintain state across executions with$checkpoint.
async (event, steps) => {
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
}
22
const axios = require('axios');

const data = 'username=jeremy%40lesptispetons.com&password=*9P0%25vhOWKqxWJi&grant_type=password&scope=read%20write&client_secret=31415926535897&client_id=themisto'
$event.response = (await axios({
  method: 'post',
  url: 'https://app.opticreche.fr/oauth/token',
  data,
  headers: {
    'Accept': 'application/json, text/plain, */*',
    'Connection': 'keep-alive',
    'Origin': 'https://app.opticreche.fr',
    'Referer': 'https://app.opticreche.fr/',
    'Content-Type': 'application/x-www-form-urlencoded',
    'Authorization': 'Basic dGhlbWlzdG86MzE0MTU5MjY1MzU4OTc=',
    'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36',
    'Host': 'app.opticreche.fr',
    'Accept-Encoding': 'gzip, deflate, br',
    'Accept-Language': 'fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7'
  },
})).data
steps.
nodejs_1
auth
to use OAuth tokens and API keys in code via theauths object
code
Write any Node.jscodeand use anynpm package. You can alsoexport datafor use in later steps via return or this.key = 'value', pass input data to your code viaparams, and maintain state across executions with$checkpoint.
async (event, steps) => {
1
2
3
4
5
6
7
8
9
10
11
12
}
13
const axios = require('axios');

var options = {
  url: 'https://app.opticreche.fr/api/auth/changeStructure/144',
  headers: {
    'Authorization': 'Bearer ' + $event.response.access_token,
    'Accept': 'application/json'
  }
}

const response = await axios(options)
steps.
nodejs_2
auth
to use OAuth tokens and API keys in code via theauths object
code
Write any Node.jscodeand use anynpm package. You can alsoexport datafor use in later steps via return or this.key = 'value', pass input data to your code viaparams, and maintain state across executions with$checkpoint.
async (event, steps) => {
1
2
3
4
5
6
7
8
9
10
11
12
13
}
14
const axios = require('axios');

var options = {
  url: 'https://app.opticreche.fr/api/auth/demande_admission',
  headers: {
    'Authorization': 'Bearer ' + $event.response.access_token,
    'Accept': 'application/json'
  }
}

const response = await axios(options)
$event.body = response.data