Skip to main content
Solved

Lendo dados de atividade do usuário / Reading user activity data


Forum|alt.badge.img+3

Olá, em meu projeto estou conseguindo ler as informações do usuário, porém não estou conseguindo acessar as atividades. Sempre recebo o "IsSuccessStatusCode" false. Detalhe vou deixar uma imagem do meu código para facilitar. Li a documentação mais vezes e ainda não entendi o que estou fazendo de errado, se alguém puder me auxiliar, por favor! 

TRANSLATION: Hello, in my project I am able to read user information, but I am not able to access the activities. I always get "IsSuccessStatusCode" false. In detail, I will leave an image of my code to make it easier. I read the documentation several times and I still don't understand what I'm doing wrong, if anyone can help me, please!

Best answer by ActivityFix

Verifique se está a pedir o âmbito "activity:read" ou "activity:read_all" ao autorizar um utilizador -- https://developers.strava.com/docs/authentication/#detailsaboutrequestingaccess

TRANSLATION: Check whether you are requesting the "activity:read" or "activity:read_all" scope when authorizing a user -- https://developers.strava.com/docs/authentication/#detailsaboutrequestingaccess

View original
Did this topic help you find an answer to your question?

3 replies

ActivityFix
Superuser
Forum|alt.badge.img+24
  • Superuser
  • 244 replies
  • Answer
  • March 22, 2024

Verifique se está a pedir o âmbito "activity:read" ou "activity:read_all" ao autorizar um utilizador -- https://developers.strava.com/docs/authentication/#detailsaboutrequestingaccess

TRANSLATION: Check whether you are requesting the "activity:read" or "activity:read_all" scope when authorizing a user -- https://developers.strava.com/docs/authentication/#detailsaboutrequestingaccess


Forum|alt.badge.img+3
  • Author
  • Hub Rookie
  • 1 reply
  • March 23, 2024

Obrigado pela ajuda! esqueci de adicionar "activity:read_all" na minha url para o usuário autorizar. Agora estou com outra dúvida, na documentação tem algum exemplo mostrando uma forma correta de solicitar os dados de treino do usuário ? em meu print acima, desta vez o método retornou true, mas não encontrou nenhuma atividade.

TRANSLATION: Thank you for your help! I forgot to add "activity:read_all" in my url for the user to authorize. Now I have another question, is there an example in the documentation showing a correct way to request the user's training data? in my screenshot above, this time the method returned true, but found no activity.


ActivityFix
Superuser
Forum|alt.badge.img+24
  • Superuser
  • 244 replies
  • March 23, 2024

Os campos "before" e "after" têm de ser marcas temporais de época (em segundos).
Deve definir "page" como 1 para os resultados iniciais.
"per_page" deve ser um número entre 1-200, recomendo o valor 200 se estiver a obter todas as actividades.

Se receber 200 resultados, efectue a mesma consulta com page=2 e repita até não receber mais resultados.

---

The "before" and "after" fields need to be epoch timestamps (in seconds).
You should set "page" to 1 for the initial results.
"per_page" should be a number between 1-200, I recommend 200 value if you are getting all activities.

If you receive 200 results, make the same query with page=2, and repeat until no more results are received.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept, you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings