IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Développement de jobs Discussion :

récupérer données API en csv


Sujet :

Développement de jobs

  1. #1
    Membre à l'essai
    Homme Profil pro
    Étudiant
    Inscrit en
    Avril 2022
    Messages
    36
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Avril 2022
    Messages : 36
    Points : 23
    Points
    23
    Par défaut récupérer données API en csv
    Bonjour,
    Je bute sur un problème de conception talend-API pour récupérer des données via une API en csv. l'url est la suivante :
    Url: https://bbmc.ouhsc.edu/redcap/api/
    token : 9A81268476645C4E5F03428B8AC3AA7B
    content: record
    format: csv
    Je suis novice en la matière, je m'y prends mal, j'ai connecté un TrestClient à TextractJason puis map ... Je ne sais pas ce qu'il faut mettre dans les paramètres de la TrestClient. Je ne sais même pas s'il faut l'utiliser...
    Je vous en serais très reconnaissant si vous pouvez m'aider dans la conception du job
    En vous remerciant par avance
    DE

  2. #2
    Candidat au Club
    Homme Profil pro
    Chef de projet SI
    Inscrit en
    Mai 2022
    Messages
    3
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 30
    Localisation : France, Hauts de Seine (Île de France)

    Informations professionnelles :
    Activité : Chef de projet SI
    Secteur : Administration - Collectivité locale

    Informations forums :
    Inscription : Mai 2022
    Messages : 3
    Points : 4
    Points
    4
    Par défaut
    Bonjour,

    Je n'ai pas tout compris dans votre demande, vous souhaitez récuperer via votre API https://bbmc.ouhsc.edu/redcap/api/ des fichiers csv ?

    Merci d'être plus exhaustif dans votre demande, je ferais mon maximum pour vous aider.

  3. #3
    Membre à l'essai
    Homme Profil pro
    Étudiant
    Inscrit en
    Avril 2022
    Messages
    36
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Avril 2022
    Messages : 36
    Points : 23
    Points
    23
    Par défaut récupérer données API en csv
    Bonjour,
    Merci pour votre retour, enfin une personne qui s'intéresse à ma demande :-)
    Oui, en effet, c'est exactement ça, je voudrais dans un premier temps extraire les CSV. Je ne sais pas comment m'y prendre, comment paramétrer chaque composant , en partant du TrestClient ...Il y'a une table contenant 5 enregistrement . (variables : record_id,name_first,name_last,address,telephone,email,dob,age,sex,demographics_complete,height,weight,bmi,comments,mugshot,health_complete,race___1,race___2,race___3,race___4,race___5,race___6,ethnicity,interpreter_needed,race_and_ethnicity_complete)

    Il y a un tuto qui montrait en diagonal comment s'y prendre sans trop expliqué :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    let
        actualUrl = "https://bbmc.ouhsc.edu/redcap/api/",
        record  =[token="9A81268476645C4E5F03428B8AC3AA7B",
        content="record",
        format="csv"
        ],
        body = Text.ToBinary(Uri.BuildQueryString(record)),
        options = [Headers =[#"Content-type"="application/x-www-form-urlencoded"], Content=body],
        result = Web.Contents(actualUrl, options)
     
    in
        result
    Je vous en serais très reconnaissant si vous pouvez me guider
    Bonne fin de journée
    DE



    Description de l'API :
    Method Name
    Export Records

    Description
    This method allows you to export a set of records for a project.

    Note about export rights: Please be aware that Data Export user rights will be applied to this API request. For example, if you have 'No Access' data export rights in the project, then the API data export will fail and return an error. And if you have 'De-Identified' or 'Remove all tagged Identifier fields' data export rights, then some data fields *might* be removed and filtered out of the data set returned from the API. To make sure that no data is unnecessarily filtered out of your API request, you should have 'Full Data Set' export rights in the project.

    URL
    https://redcap.hegp.inserm.fr/api/
    Supported Request Method
    POST


    Permissions Required
    To use this method, you must have API Export privileges in the project.


    Parameters (case sensitive)

    Required

    token
    The API token specific to your REDCap project and username (each token is unique to each user for each project). See the section on the left-hand menu for obtaining a token for a given project.


    content
    record


    format
    csv, json, xml [default], odm (‘odm’ refers to CDISC ODM XML format, specifically ODM version 1.3.1)


    type
    • flat - output as one record per row [default]
    • eav - output as one data point per row
    • Non-longitudinal: Will have the fields - record, field_name, value Longitudinal: Will have the fields - record, field_name, value, redcap_event_name
    • ‘record’ refers to the record ID for the project




    Optional

    records
    an array of record names specifying specific records you wish to pull (by default, all records are pulled)


    fields
    an array of field names specifying specific fields you wish to pull (by default, all fields are pulled)


    forms
    an array of form names you wish to pull records for. If the form name has a space in it, replace the space with an underscore (by default, all records are pulled)


    events
    an array of unique event names that you wish to pull records for - only for longitudinal projects


    rawOrLabel
    raw [default], label - export the raw coded values or labels for the options of multiple choice fields


    rawOrLabelHeaders
    raw [default], label - (for ‘csv’ format ‘flat’ type only) for the CSV headers, export the variable/field names (raw) or the field labels (label)


    exportCheckboxLabel
    true, false [default] - specifies the format of checkbox field values specifically when exporting the data as labels (i.e., when rawOrLabel=label) in flat format (i.e., when type=flat). When exporting labels, by default (without providing the exportCheckboxLabel flag or if exportCheckboxLabel=false), all checkboxes will either have a value ‘Checked’ if they are checked or ‘Unchecked’ if not checked. But if exportCheckboxLabel is set to true, it will instead export the checkbox value as the checkbox option’s label (e.g., ‘Choice 1’) if checked or it will be blank/empty (no value) if not checked. If rawOrLabel=false or if type=eav, then the exportCheckboxLabel flag is ignored. (The exportCheckboxLabel parameter is ignored for type=eav because ‘eav’ type always exports checkboxes differently anyway, in which checkboxes are exported with their true variable name (whereas the ‘flat’ type exports them as variable___code format), and another difference is that ‘eav’ type always exports checkbox values as the choice label for labels export, or as 0 or 1 (if unchecked or checked, respectively) for raw export.)


    returnFormat
    csv, json, xml - specifies the format of error messages. If you do not pass in this flag, it will select the default format for you passed based on the ‘format’ flag you passed in or if no format flag was passed in, it will default to ‘xml’.


    exportSurveyFields
    true, false [default] - specifies whether or not to export the survey identifier field (e.g., ‘redcap_survey_identifier’) or survey timestamp fields (e.g., instrument+’_timestamp’) when surveys are utilized in the project. If you do not pass in this flag, it will default to ‘false’. If set to ‘true’, it will return the redcap_survey_identifier field and also the survey timestamp field for a particular survey when at least one field from that survey is being exported. NOTE: If the survey identifier field or survey timestamp fields are imported via API data import, they will simply be ignored since they are not real fields in the project but rather are pseudo-fields.


    exportDataAccessGroups
    true, false [default] - specifies whether or not to export the ‘redcap_data_access_group’ field when data access groups are utilized in the project. If you do not pass in this flag, it will default to ‘false’. NOTE: This flag is only viable if the user whose token is being used to make the API request is not in a data access group. If the user is in a group, then this flag will revert to its default value.


    filterLogic
    String of logic text (e.g., [age] > 30) for filtering the data to be returned by this API method, in which the API will only return the records (or record-events, if a longitudinal project) where the logic evaluates as TRUE. This parameter is blank/null by default unless a value is supplied. Please note that if the filter logic contains any incorrect syntax, the API will respond with an error message.

Discussions similaires

  1. [XL-2007] Récupérer données de fichiers CSV sur mon XLSM
    Par Sherito dans le forum Macros et VBA Excel
    Réponses: 4
    Dernier message: 18/09/2018, 16h06
  2. [WD19] Récupérer données localisation GPS API Windows
    Par Romanops dans le forum WinDev
    Réponses: 1
    Dernier message: 11/09/2014, 17h33
  3. Réponses: 1
    Dernier message: 24/08/2010, 21h33
  4. Réponses: 5
    Dernier message: 11/07/2010, 14h07
  5. Réponses: 10
    Dernier message: 02/04/2007, 17h22

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo