API requests returns errors

Hi all,

I am creating a web application with Angular to collect data and store it on the DHIS2 server. I used to make api calls to a server with version 36.4, now I’m trying to use another one with version 37.10 but it won’t let me log in.
Could it be that these endpoints are not available in this version?

export const endpoints = {
// Auth
authorization: 37/me/authorization,
userSettings: 37/me/userSettings,
userInfo: 37/me,
systemInfo: system/info,

// Tracked Entity
trackedEntityInstances: trackedEntityInstances, // trackedEntityInstances/query.json?ou=C7UVYRGE2d1&ouMode=SELECTED&&order=created:desc&program=RWGqus8n2x3
trackedEntityPatient: trackedEntityInstances, // F29grs8Eb0b.json?program=RWGqus8n2x3&fields=*
trackedEntityAttributes: “trackedEntityAttributes”,
// Put data
events: events
};

This is the error that I am getting:

I hope someone can help me, thank you very much in advance.

Hi @Alba

Out of these, /me/authorization, /me, /systemSettings, system/info, are working; however, /me/userSettings is an invalid endpoint. It has not been mentioned in all of the versions of DHIS2. You can review these endpoints here: Users - DHIS2 Documentation and Settings and configuration - DHIS2 Documentation

The tracker endpoints you are using are deprecated, please check the note in the documentation: Tracker - DHIS2 Documentation

If you don’t mind me asking. Why not create the app using ReactJs and making use of the DHIS2 App Platform? Is it something that can’t be done using ReactJs?

I see it says “unauthorized” so please check the authorities.

Hi,

I have been creating a basic login just to see if it would connect to the server by entering the login credentials and I still get the same. I get the message that it is not authorised, but it is a superuser that has access to everything and if I look for the server url I can access the platform perfectly.

Could it be something to do with the server configuration?

Regarding why I’m using Angular and not React it was because it was recommended to me to create the web app but I understand that React could be used. The problem is that everything was working with those credentials and now it stopped working.

Attached is a screenshot of the error with the basic programme I have just configured.


And this is the code:

image

Thanks in advance.