I am getting 404 Not found error for Goals endpoint
Curl request I am using: curl -H 'Authorization: Bearer ****' -H 'Accept: application/json' -A 'Jersey/2.31' 'https://fivetran-sandbox.pipedrive.com/goals/find?period.start=2021-08-24&period.end=2021-08-25'
Domain fivetran-sandbox.pipedrive.com is correct and it’s working for other endpoints
@pm-fivetran API docs endpoints are described for https://api.pipedrive.com hence https://api.pipedrive.com/v1/goals/find works as expected. But the recommended way is to use company domain, https://fivetran-sandbox.pipedrive.com/api/v1/goals/find, in that case you need to use /api/v1 not just /v1.
This error can happen if your period.start does not match Goal’s period start, as one cannot ask for results of a goal if the goal is not running during the specified period.
Thanks @mykhailo got it, So we can query GOAL_RESULT using duration.start and duration.end of a goal. So it means duration.start would always be not null.
I double-checked one more time and it seems like it might fail for both cases, when a connected pipeline does not exist, or a connected pipeline exists but has no stages.
As your pipeline exists but has no stages, can you add a stage there and try again?
Also, 403 can happen when you try to call an endpoint with access token that has no access to that endpoint. For example, I see that you have something related to Leads, but you don’t have leads scope. Which means, when you call Leads endpoints you will get 403.
Hi @mykhailo I want to update the scopes you mentioned in my app.
Currently, my other endpoints are working fine, so when I update scopes in my app then would other endpoints also fail on 401 UnAuthorized error, or would they be working fine?
Thanks @mykhailo So just to confirm once I update the scopes other endpoints would succeed once we refresh token, customers wont need to re-authorise with app if they dont need these new endpoints
Yes, but as I mentioned before, existing access tokens will become invalid, similar to the case when they expire and need to be refreshed. Hence, your app should be able to handle this case, otherwise once a scope is added existing users will not be able to use the app without re-install.
If it’s still unclear, I do recommend creating another app, just for testing (no need to publish), and test that scenario there (no need in code, you can make requests with Postman for example). So you could see what happens with tokens before a scope is added and after.