← Back to team overview

dhis2-devs team mailing list archive

Re: WebApi failing Email, FileResources and

 

Hi Halvdan,

Thanks. We'll do.

Regards,
Mike

On Fri, Jun 3, 2016 at 4:05 PM, Halvdan Hoem Grelland <halvdan@xxxxxxxxx>
wrote:

> Mike:
>
> You would save the file on the api/fileResource endpoint, get the UID
> back, then save the uid as of a dataValue on the event. Example:
>
> POST to api/fileResources, get id: “a11111bbbb” back.
> PUT the event as usual:
>
> {
>   "event" : "<some-event-uid>",
>   "dataValues" : [
>     {
>       "value" : "a11111bbbb",
>       "dataElement" : "<some-fileResource-dataelement-uid>"
>     }
>   ]
> }
>
> ​
>
> On Fri, Jun 3, 2016 at 3:11 PM, Mike Nelushi <mikeevolution@xxxxxxxxx>
> wrote:
>
>> Hi Halvdan,
>>
>> I'm still failing to understand how you would link each user's
>> files(Tracker Program) to a datavalue(DE, PE, OU). Can you please give an
>> example on this scenario?
>>
>> Regards,
>> Mike
>>
>> On Fri, Jun 3, 2016 at 1:13 PM, Mike Nelushi <mikeevolution@xxxxxxxxx>
>> wrote:
>>
>>> Hi Halvdan,
>>>
>>> We are using version 2.23. The application uses a tracker program and
>>> its suppose to store documents for each user. I can store the file using
>>> fileResources api, and the response storageStatus=PENDING with no
>>> errors thrown. So from the response object I have to  create a
>>> dataValue(using DE of type file) then "Store the retrieved id as the value
>>> to that data value".  Am I correct?
>>>
>>> Regards,
>>> Mike
>>>
>>> On Fri, Jun 3, 2016 at 11:05 AM, Halvdan Hoem Grelland <
>>> halvdan@xxxxxxxxx> wrote:
>>>
>>>> Hi Mike,
>>>>
>>>> In relation to api/fileResources I'm going to need more details: which
>>>> version are you on, exactly what are you trying to do, etc. A full list of
>>>> typically needed details can be found here
>>>> <http://dhis2.github.io/dhis2-docs/master/en/implementer/html/ch09s03.html>,
>>>> but specifically I'll need to know whether there are any thrown errors on
>>>> the server, what HTTP response you are getting and so forth.
>>>>
>>>> Also, have you familiarised yourself with the documentation for the
>>>> fileResource API
>>>> <http://dhis2.github.io/dhis2-docs/master/en/developer/html/ch01s12.html> ?
>>>> In particular make sure to read and understand the constraints (i.e. a FR
>>>> must be referenced by a DataValue).
>>>>
>>>> On Fri, Jun 3, 2016 at 4:58 AM, Morten Olav Hansen <morten@xxxxxxxxx>
>>>> wrote:
>>>>
>>>>> Hi Mike
>>>>>
>>>>> I'm adding in the dev list, and Halvdan (who knows about file resource
>>>>> API). I will have a look at the start as app functionality.
>>>>>
>>>>> --
>>>>> Morten
>>>>>
>>>>> On Thu, Jun 2, 2016 at 5:00 PM, Mike Nelushi <mikeevolution@xxxxxxxxx>
>>>>> wrote:
>>>>>
>>>>>> Hi Calle,
>>>>>>
>>>>>> Apologies, forgot to add you on this thread.
>>>>>>
>>>>>> Regards
>>>>>> Mike
>>>>>> On 2 Jun 2016 11:35, "Mike Nelushi" <mikeevolution@xxxxxxxxx> wrote:
>>>>>>
>>>>>>> Hi Morten,
>>>>>>>
>>>>>>> Its Mike here from HISP-SA.
>>>>>>>
>>>>>>> We have been strangling to send email to individual users on our new
>>>>>>> Community Service Application which is going live tomorrow. At the moment
>>>>>>> when I send an email to individuals it sends to everyone who is a DHIS2
>>>>>>> user. Im user the dhis2.23 messageConversations web-api for this.
>>>>>>>
>>>>>>> A. The following are the two json objects I've used, the first one
>>>>>>> doesn't send messages at all the messages stays on dhis2 mail.
>>>>>>> 1. var json_Data = {"subject": subject, "text": message, "users":
>>>>>>> users};
>>>>>>> 2.var json_Data = {"subject": subject, "text": message, "users":
>>>>>>> users, "organisationUnits": organisationUnits};
>>>>>>>
>>>>>>>
>>>>>>> The following is our email settings
>>>>>>>
>>>>>>> [image: Inline image 1]
>>>>>>>
>>>>>>> B. Second Issue is that when we call fileResources webapi to save
>>>>>>> file is does work but when you retrieve the file it says the file was not
>>>>>>> saved. The following is the object:
>>>>>>>                                     var file = item[0].files[0];
>>>>>>>                                     var formData = new FormData();
>>>>>>>                                     formData.append('file', file);
>>>>>>>
>>>>>>> C. The start page function on Appearance settings is not working if
>>>>>>> you choice your own custom APP, when logging in it does it go to the
>>>>>>> landing page instead it goes to index.action.
>>>>>>>
>>>>>>> Can you please help us with this issues?
>>>>>>>
>>>>>>> Regards,
>>>>>>> Mike
>>>>>>>
>>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Mailing list: https://launchpad.net/~dhis2-devs
>>>>> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
>>>>> Unsubscribe : https://launchpad.net/~dhis2-devs
>>>>> More help   : https://help.launchpad.net/ListHelp
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Halvdan Hoem Grelland
>>>> Software developer, DHIS 2
>>>> University of Oslo
>>>> http://www.dhis2.org <https://www.dhis2.org/>
>>>>
>>>>
>>>
>>
>
>
> --
> Halvdan Hoem Grelland
> Software developer, DHIS 2
> University of Oslo
> http://www.dhis2.org <https://www.dhis2.org/>
>
>

PNG image


References