IDN Source Copy existing to new

Hello,
Is there a straightforward method to copy a Web Services source to create another one?
The method I have tried is to create a new source in the IDN UI. Go to Postmand and get the original source and the new source JSON then copy the original source lower body to the new source and perform an update. I have had limited success with this method.

You can try using the SP-Config API. Extended documentation here.

This API has the ability to export certain configuration objects (listed in the extended docs), like sources, and then import those objects into IDN. The primary use case is to export all configuration items from a lower environment into a production environment, but I don’t see why you couldn’t use it to copy a source.

Thanks Colin,
This looks promising. Are there any Postman examples of this available?
I have tried {{api-url}}/beta/sp-config/export and I get back this message:
{
“messages”: [
{
“locale”: “en-US”,
“text”: “Content type ‘’ not supported”,
“localeOrigin”: “DEFAULT”
}
],
“trackingId”: “b6a24c8d51bd4ff3987ac434399af8fc”,
“detailCode”: “400.0 Bad request syntax”
}

Not supported and bad request?
Any ideas, I must be missing something.

At a bare minimum, you need to supply an empty object in the request payload to export all objects.

curl --location --request POST 'https://{tenant}.api.identitynow.com/beta/sp-config/export' \
--header 'Authorization: Bearer {access_token}' \
--header 'Content-Type: application/json' \
--data-raw '{}'

The error you are receiving is because you have nothing in your request body.

If you want to export all source objects in your tenant, use this command:

curl --location --request POST 'https://{tenant}.api.identitynow.com/beta/sp-config/export' \
--header 'Authorization: Bearer {access_token}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "description": "Test Source Export AD Transforms",
    "excludeTypes": [
    ],
    "includeTypes": [
        "SOURCE"
    ],
    "objectOptions": {
    }
}'

Finally, if you only want to export specific sources, use the list sources endpoint to find the IDs of the sources you want to export and include them in your request.

curl --location --request POST 'https://{tenant}.api.identitynow.com/beta/sp-config/export' \
--header 'Authorization: Bearer {access_token}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "description": "Test Source Export AD Transforms",
    "excludeTypes": [
    ],
    "includeTypes": [
        "SOURCE"
    ],
    "objectOptions": {
        "SOURCE": {
            "includedIds": [
                "be9e116d-08e1-49fc-ab7f-fa585e96c9e4"
            ]
        }
    }
}'

Hey Colin,
Now I understand what I was missing. This is very helpful.

Thanks,
Chris

The import process has a field or two I don’t understand and I am not finding in the docs.
Example from the doc modified with source:
–data-raw
data: “source-config_export_34f387b4-9d26-4940-a27e-6a252b7a59e3.json”,
options:

{
  "excludeTypes": [],
  "includeTypes": ["SOURCE"],
  "objectOptions": {
    "SOURCE": {
      "includedIds": [ "d11a705d-614e-40d2-bdf5-2476d073a6de"],
      "includedNames":[]
    }
  },
  "defaultReferences": [
    {
      "type": "SOURCE",
      "id": "d11a705d-614e-40d2-bdf5-2476d073a6de",
      "name": "Test Copy"
    }
  ]
}

What is the “defaultReferences” referring to where does the id come from? Is the type “SOURCE”?

This is not working because the export json has id of the source. I renamed each reference of source name after exporting json and tried to import it back in same environment. It just renamed the existing source instead of creating new one.

Hello Collin,
I have finally gotten back around to working on thi again.
I have exported the “Source”
{{api-url}}/beta/sp-config/export
Body (raw json)

{
    "description": "Test Source Export AuthN Manager SOX",
    "excludeTypes": [
    ],
    "includeTypes": [
        "SOURCE"
    ],
    "objectOptions": {
        "SOURCE": {
            "includeIds": [
                "2c9180887ebb7f2b017ec6e0b2e10b61"
            ],
            "includeNames": ["Authorization Manager - SOX"]
        }
    }
}

After the export is complete I go to check the results and I see all of the sources have been exported not just the one source I am trying to capture. I only wish to export one source.
{{api-url}}/beta/sp-config/export/0f6bebfe-005d-4dc4-b39d-3d70367cda3d/download

What am I missing? Is there a detailed tutorial on this?

Best regards,
Chris

Hey @colin_mckibben is there any api for exporting application configurations??

Hi Subhash,

Welcome to the community. I’d be glad to help you out. This topic is regarding the copying of IDN sources. Can you please ask your question in a new topic so we can keep our conversations focused?

Thank you,
Colin

@ChrisOlsen I had a typo in my example. To limit which sources are exported, you have to use the includedIds field, but you have specified includeIds, which is missing a ‘d’. Same thing for includedNames. You are missing a ‘d’ in that option as well.