Project Name (if applicable, otherwise just type n/a)
n/a
Question
I have two projects, one a new rework of the other, lets call them weeds-new and weed-original.
I have set up API and APPS for both ( I did new first - this may be relevant as it is the one that works!)
project weeds-new:
project Tiritiri Matangi Island weed reports
slug tiritiri-matangi-island-weed-reports
ref 1896047ff4244fe2b6c959e1d7f24867.
Name Client ID Client Secret Created At
SOTM_weeds 5885 <redacted> 04/01/2025 20:12
project weeds-original:
project Tiriweeds
slug tiriweeds
ref d09ab480b37c4d6cbf41b804a5987567
Name Client ID Client Secret Created At
SOTM_weeds_original 5886 <redacted> 04/01/2025 21:16
I note client is the same for both.
I am using pyepicollect:
CLIENT_ID = 5885
projects= {
'Tiritiri Matangi Island weed reports' :
{ "name": 'Tiritiri Matangi Island weed reports',
"slug" : 'tiritiri-matangi-island-weed-reports',
'secret': '<redacted>'
},
'Tiriweeds' : { "name": 'Tiriweeds',
"slug" : 'tiriweeds' ,
'secret': '<redacted>'
}
}
conf = projects['Tiriweeds'] # fails
#conf = projects['Tiritiri Matangi Island weed reports'] # works
print(f"project: { conf['slug']}")
result = pyep.api.search_project(conf['name'])
pprint.pp( result )
token = pyep.auth.request_token(CLIENT_ID, conf['secret'])
if not token.get('access_token'):
pp.pprint(token)
sys.exit(1)
project = pyep.api.get_project(conf['slug'], token['access_token'])
entries = pyep.api.get_entries(conf['slug'], token['access_token'])
print(f"number of entries {len(entries['data']['entries'])}")
running the script for the two projects gives:
IT412392:pytest rful011$ python3 bin/test.1.py
project: tiritiri-matangi-island-weed-reports
{'data': [{'type': 'project',
'id': '1896047ff4244fe2b6c959e1d7f24867',
'project': {'name': 'Tiritiri Matangi Island weed reports',
'slug': 'tiritiri-matangi-island-weed-reports',
'access': 'private',
'ref': '1896047ff4244fe2b6c959e1d7f24867'}}]}
number of entries 1
IT412392:pytest rful011$ python3 bin/test.1.py
project: tiriweeds
{'data': [{'type': 'project',
'id': 'd09ab480b37c4d6cbf41b804a5987567',
'project': {'name': 'Tiriweeds',
'slug': 'tiriweeds',
'access': 'private',
'ref': 'd09ab480b37c4d6cbf41b804a5987567'}}]}
{ 'errors': [ { 'code': 'ec5_253',
'source': 'token issue',
'title': 'Invalid client credentials.'}]}
I have checked and rechecked the secret values…
update: I tried deleting and recreating both APP entries and now neither work. Sigh… At least that is consistent!
Any one know what is going on ?