Hi dear Community
I am trying to import the below csv file with the following command without success (into play.dhis2.org/2.35.0):
curl -d @events-6.csv "https://play.dhis2.org/2.35.0/api/events.csv?skipFirst=true&dryRun=false&payloadFormat=csv" -H "Content-Type:application/csv" -u "admin:district" -v
Please let me know what I am doing wrong.
Note: events-6.csv file is working well when used with Import/Export App.
Content of events-6.csv:
event,status,program,programStage,enrollment,orgUnit,eventDate,dueDate,latitude,longitude,dataElement,value,storedBy,providedElsewhere,completedDate,completedBy,geometry
bcdf88cedc2,ACTIVE,VBqh0ynB2wv,pTo4uMt3xur,,DiszpKrYNg8,2020-08-24T00:00:00.000,2020-08-24,8.06311527044516,-11.4283223849698,F3ogKBuviRA,"[-11.4234147333302,8.04129958345372]",bjorn,false,,,"POINT (-11.4283223849698 8.06311527044516)"
bcdf88cedc2,ACTIVE,VBqh0ynB2wv,pTo4uMt3xur,,DiszpKrYNg8,2020-08-24T00:00:00.000,2020-08-24,8.06311527044516,-11.4283223849698,oZg33kd9taw,Female,bjorn,false,,,"POINT (-11.4283223849698 8.06311527044516)"
bcdf88cedc2,ACTIVE,VBqh0ynB2wv,pTo4uMt3xur,,DiszpKrYNg8,2020-08-24T00:00:00.000,2020-08-24,8.06311527044516,-11.4283223849698,qrur9Dvnyt5,23,bjorn,false,,,"POINT (-11.4283223849698 8.06311527044516)"
The above curl command returns no error message (see below) but obviously the event has been imported:
https://play.dhis2.org/2.35.0/api/events/bcdf88cedc2.json
=> ERROR: âEvent not found for ID bcdf88cedc2â
- Trying 34.243.233.59:443âŚ
- TCP_NODELAY set
- Connected to play.dhis2.org (34.243.233.59) port 443 (#0)
- ALPN, offering h2
- ALPN, offering http/1.1
- successfully set certificate verify locations:
- CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs - TLSv1.3 (OUT), TLS handshake, Client hello (1):
- TLSv1.3 (IN), TLS handshake, Server hello (2):
- TLSv1.2 (IN), TLS handshake, Certificate (11):
- TLSv1.2 (IN), TLS handshake, Server key exchange (12):
- TLSv1.2 (IN), TLS handshake, Server finished (14):
- TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
- TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
- TLSv1.2 (OUT), TLS handshake, Finished (20):
- TLSv1.2 (IN), TLS handshake, Finished (20):
- SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
- ALPN, server accepted to use h2
- Server certificate:
- subject: CN=
play.dhis2.org
- start date: Nov 5 02:01:55 2020 GMT
- expire date: Feb 3 02:01:55 2021 GMT
- subjectAltName: host
"play.dhis2.org"
matched certâs"play.dhis2.org"
- issuer: C=US; O=Letâs Encrypt; CN=Letâs Encrypt Authority X3
- SSL certificate verify ok.
- Using HTTP2, server supports multi-use
- Connection state changed (HTTP/2 confirmed)
- Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
- Server auth using Basic with user âadminâ
- Using Stream ID: 1 (easy handle 0x5564c1f0df20)
> POST /2.35.0/api/events.csv?skipFirst=true&dryRun=false&payloadFormat=csv HTTP/2
> Host:play.dhis2.org
> authorization: Basic YWRtaW46ZGlzdHJpY3Q=
> user-agent: curl/7.68.0
> accept: /
> content-type:application/csv
> content-length: 806
> - Connection state changed (MAX_CONCURRENT_STREAMS == 128)!
- We are completely uploaded and fine
< HTTP/2 200
< server: nginx/1.17.10
< date: Wed, 25 Nov 2020 13:09:08 GMT
< content-type: application/json;charset=UTF-8
< content-length: 877
< set-cookie: JSESSIONID=186AB380AE0F47BA77888B42BC5C5C82; Path=/2.35.0; SameSite=Lax; Secure; HttpOnly
< x-content-type-options: nosniff
< x-xss-protection: 1; mode=block
< x-frame-options: SAMEORIGIN
< strict-transport-security: max-age=15768000
< - Connection #0 to host
play.dhis2.org
left intact
Post request response:
{
âhttpStatusâ: âOKâ,
âhttpStatusCodeâ: 200,
âstatusâ: âOKâ,
âmessageâ: âImport was successful.â,
âresponseâ: {
âresponseTypeâ: âImportSummariesâ,
âstatusâ: âSUCCESSâ,
âimportedâ: 0,
âupdatedâ: 0,
âdeletedâ: 0,
âignoredâ: 0,
âimportOptionsâ: {
âidSchemesâ: {},
âdryRunâ: false,
âasyncâ: false,
âimportStrategyâ: âCREATE_AND_UPDATEâ,
âmergeModeâ: âREPLACEâ,
âreportModeâ: âFULLâ,
âskipExistingCheckâ: false,
âsharingâ: false,
âskipNotificationsâ: false,
âskipAuditâ: false,
âdatasetAllowsPeriodsâ: false,
âstrictPeriodsâ: false,
âstrictDataElementsâ: false,
âstrictCategoryOptionCombosâ: false,
âstrictAttributeOptionCombosâ: false,
âstrictOrganisationUnitsâ: false,
ârequireCategoryOptionComboâ: false,
ârequireAttributeOptionComboâ: false,
âskipPatternValidationâ: false,
âignoreEmptyCollectionâ: false,
âforceâ: false,
âfirstRowIsHeaderâ: true,
âskipLastUpdatedâ: false,
âmergeDataValuesâ: false,
âskipCacheâ: false
},
âimportSummariesâ: [],
âtotalâ: 0
}
}