### Method

# Secret Service create_item_dbus_path_sync

#### Declaration [src]

    gchar*
    secret_service_create_item_dbus_path_sync (
      SecretService* self,
      const gchar* collection_path,
      GHashTable* properties,
      SecretValue* value,
      SecretItemCreateFlags flags,
      GCancellable* cancellable,
      GError** error
    )

#### Description [src]

Create a new item in a secret service collection and return its D-Bus object path.

It is often easier to use `secret_password_store_sync()` or `secret_item_create_sync()` rather than using this function. Using this method requires that you setup a correct hash table of D-Bus `properties` for the new collection.

If the `flags` contains `SECRET_ITEM_CREATE_REPLACE`, then the secret service will search for an item matching the `attributes`, and update that item instead of creating a new one.

`properties` is a set of properties for the new collection. The keys in the hash table should be interface.property strings like `org.freedesktop.Secret.Item.Label`. The values in the hash table should be `GVariant` values of the properties.

This method may block indefinitely and should not be used in user interface threads. The secret service may prompt the user. `secret_service_prompt()` will be used to handle any prompts that are required.

Stability: Unstable

#### Parameters

`collection_path`

  Type: `const gchar*`

  The D-Bus path of the collection in which to create item.

  The data is owned by the caller of the method.
  The value is a NUL terminated UTF-8 string.

`properties`

  Type: `GHashTable`

  Hash table of D-Bus properties for the new collection.

  The data is owned by the caller of the method.

`value`

  Type: `SecretValue`

  The secret value to store in the item.

  The data is owned by the caller of the method.

`flags`

  Type: `SecretItemCreateFlags`

  Flags for the creation of the new item.

`cancellable`

  Type: `GCancellable`

  Optional cancellation object.

  The argument can be `NULL`.
  The data is owned by the caller of the method.

`error`

  Type: `GError **`

  The return location for a recoverable error.

  The argument can be `NULL`.
  If the return location is not `NULL`, then you must initialize it to a `NULL` `GError*`.
  The argument will be left initialized to `NULL` by the method if there are no errors.
  In case of error, the argument will be set to a newly allocated `GError`; the caller will take ownership of the data, and be responsible for freeing it.

#### Return value

Type: `gchar*`

A new string containing the D-Bus object path of the item.

The caller of the method takes ownership of the data, and is responsible for freeing it.
The value is a NUL terminated UTF-8 string.