Answers.Body: <p>You can do this using the <a href="https://docs.civicrm.org/dev/en/latest/api/v3/changes/#460-attachment-api" rel="nofollow noreferrer">Attachment api</a>. Use the API explorer on your own Civi site to see available parameters for this api.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2015-05-30T17:07:14.343Z
Answers.LastActivityDate: 2021-01-05T08:06:35.630Z
Answers.LastEditDate: 2021-01-05T08:06:35.630Z
Answers.UserDisplayName: Coleman
Answers.Body: <p>You can create a custom group with the CustomGroup API, and custom fields with the CustomField API. Is that what you mean, or do you mean updating the actual data within a custom file?</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-30T13:28:27.557Z
Answers.Text: Sorry my english's probably bad... I'm trying to say that I want to create a new line in the database. CustomGroup and CustomField already exists. What I need is to create a new "object" through the API to save it in the database.
Answers.UserDisplayName: matthias de mauroy
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-30T13:34:57.617Z
Answers.Text: It depends on the entity your are adding too in my experience. I think for example for the Contact entity, you can add something like custom_25='yourvalue' to the Contact Create param set. In theory you can also use the CustomValue API but that is a bit of a beast...So I tend to use CRM_Core_DAO::executeQuery() if I can not use the entity API. Let me know if this helps you or if you are not aware of the CRM_Core_DAO::executeQuery method
Answers.UserDisplayName: ErikH - CiviCooP
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-30T13:49:38.707Z
Answers.Text: I know about CRM_Core_DAO functions and some of others Core functions. Thing is I wanted a "simple" way to store files through the API. If nothing exists right now I will just do is with CRM_Core functions. Anyway thank's a lot for your help !
Answers.UserDisplayName: matthias de mauroy
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-30T13:50:44.140Z
Answers.Text: You might want to try with the CustomValue API? Perhaps I am exaggerating....
Answers.UserDisplayName: ErikH - CiviCooP
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-30T13:24:17.493Z
Answers.LastActivityDate: 2015-04-30T13:24:17.493Z
Answers.UserDisplayName: ErikH - CiviCooP
Body: <p>I was wondering how to do that. Didn't find it for that type of custom data.</p>
  
  <p>If possible I want to do it via API, if not possible i'll try with CRM_Core files.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-04-30T13:33:21.927Z
Comments.Text: Are you saying you want to use the API to create/upload a file at the server?
Comments.UserDisplayName: Nicholai
Tags: <custom-fields>
Title: How to create file type custom data with API?
ThreadText: # How to create file type custom data with API?
  
  (Asked by: username_0 on 2015-04-30)
  
  I was wondering how to do that. Didn't find it for that type of custom data.
  
  If possible I want to do it via API, if not possible i'll try with CRM\_Core files.
  
  **Tags:** custom-fields
  
  > **Comments:**
  > **username_1**: Are you saying you want to use the API to create/upload a file at the server?  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2015-05-30. Score: 1
  
  You can do this using the [Attachment api](https://docs.civicrm.org/dev/en/latest/api/v3/changes/#460-attachment-api). Use the API explorer on your own Civi site to see available parameters for this api.
  
  
  ---
  
  ### Answer by username_3 on 2015-04-30. Score: 1
  
  You can create a custom group with the CustomGroup API, and custom fields with the CustomField API. Is that what you mean, or do you mean updating the actual data within a custom file?
  
  > **Comments:**
  > **username_0**: Sorry my english's probably bad... I'm trying to say that I want to create a new line in the database. CustomGroup and CustomField already exists. What I need is to create a new "object" through the API to save it in the database.  
  > **username_3**: It depends on the entity your are adding too in my experience. I think for example for the Contact entity, you can add something like custom_25='yourvalue' to the Contact Create param set. In theory you can also use the CustomValue API but that is a bit of a beast...So I tend to use CRM_Core_DAO::executeQuery() if I can not use the entity API. Let me know if this helps you or if you are not aware of the CRM_Core_DAO::executeQuery method  
  > **username_0**: I know about CRM_Core_DAO functions and some of others Core functions. Thing is I wanted a "simple" way to store files through the API. If nothing exists right now I will just do is with CRM_Core functions. Anyway thank's a lot for your help !  
  > **username_3**: You might want to try with the CustomValue API? Perhaps I am exaggerating....  
  
  ---
  
  