Discussions

Ask a Question
Back to All

API call does nto work anymore

Hello,

we have been using shell script to update Google Directory information from Personio using api calls. It was working perfectly, but since last week it does not work anymore, part of the code below. But now nothing happens, we can get the token (the papi one) which is put in $TMP_TOKEN/TOKEN but now for the GET_REQUEST nothing is created in $TMP_TOKEN/USERS file, we tried with an empty file but still nothing. we (re)tried on the (developer.personio.de) website and token generation works and employee list as well with the token but the request seems not to have changed..... can you help with this please ?

#### token generation ####
TOKEN_REQUEST=$(curl --request POST \
    --url https://api.personio.de/v1/auth \
    --header 'accept: application/json' \
    --header 'content-type: application/json' \
    --data '
{
  "client_id": "****",
  "client_secret": "****"
}
' 2>/dev/null)


echo "$TOKEN_REQUEST" | jq .data | awk '{print $2}' | tr -d '"' | sed '/^[[:space:]]*$/d' > $TMP_TOKEN/TOKEN

#### api request get Json list of users from personio  ####

BEARER_TOKEN=$(cat $TMP_TOKEN/TOKEN)
rm -fr $TMP_TOKEN/TOKEN_*
rm -fr $TMP_TOKEN/USERS_*

GET_REQUEST=$(curl --request GET \
    --url "https://api.personio.de/v1/company/employees?limit=10&offset=0&email=$VARNAME" \
    --header 'accept: application/json' \
    --header "authorization: Bearer $BEARER_TOKEN" > $TMP_TOKEN/USERS \
	2>/dev/null)