Create API Mapping
  • 24 Nov 2024
  • 2 Minutes to read
  • Dark
    Light
  • PDF

Create API Mapping

  • Dark
    Light
  • PDF

Article summary

Post
/internal-assets/4.0/api-mapping/{envId}/{assetTemplateId}/{attributeKey}

Create a new API Mapping for the specified Asset Template ID and Attribute Key.

Notice

Accessing the APIs is through a dedicated domain/URL, according to your PlainID Tenant Location
  • United States (US) - `https://api.us1.plainid.io`
  • Canada (CA) - `https://api.ca1.plainid.io`
  • Europe (EU) - `https://api.eu1.plainid.io`
  • Local PAA - `https://api.plainid.local`


  • Using HTML Encoded Special Characters

    Use HTML encoded patterns when working with values that contain special characters like spaces, dashes, etc. Refer to this HTML URL Encoding Reference for a full list.


    Important note about headers


    cURL Sample Guidelines

    In order for the relevant parameters to appear in the cURL sample, you can input the values in the interactive API console on the right. They will then appear in the cURL sample on the bottom of the page in the correct format.

    Security
    HTTP
    Type bearer

    For more details about Administration API Authentication, check out the Authentication APIs documentation. Provide your bearer token in the Authorization header when making requests to protected resources. Example: Authorization: Bearer 123

    Path parameters
    assetTemplateId
    stringRequired

    The Asset Template ID can be found under the Details tab of the relevant Asset Type.

    envId
    string (uuid) Required

    The Environment ID can be found under the Details Tab in the Environment Settings.

    attributeKey
    stringRequired

    To locate the Attribute Key, select the relevant Asset Type and click on Asset Attributes.

    Body parameters

    API Mapping to create.

    Ensure that you input either an applicationMatcherID or an applicationName and applicationMatcherName

    by_matcher_id
    {
      "applicationMatcherId": "1e70c17a-78c3-4fd9-83f5-dbea8641147a",
      "path": "",
      "source": "BODY"
    }
    by_matcher_name
    {
      "applicationMatcherName": "matcher_name",
      "applicationName": "my_app",
      "path": "",
      "source": "BODY"
    }
    object
    applicationMatcherId
    string (uuid)
    applicationName
    string
    applicationMatcherName
    string
    source
    string
    Valid values[ "\"BODY\"", "\"HEADER\"", "\"PATH\"", "\"QUERY\"", "\"URI_REGEX\"" ]
    path
    string
    Responses
    201

    Successful operation

    Headers
    x-request-id
    string
    The ID of the request
    Expand All
    object

    Response object

    data
    Array of object (AttributeMapper)
    object
    Example{ "created_example": { "applicationMatcherId": "1e70c17a-78c3-4fd9-83f5-dbea8641147a", "path": "", "source": "BODY", "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "assetTemplateId": "3fa85f64-5717-4562-b3fc-2c963f66aqw1", "envId": "3fa85f64-5717-4562-b3fc-2c963f66aop2", "attributeKey": "attribute_key", "applicationName": "app_name", "applicationMatcherName": "matcher_name" } }
    id
    string (uuid)
    assetTemplateId
    string
    envId
    string (uuid)
    attributeKey
    string
    applicationMatcherId
    string (uuid)
    applicationName
    string
    applicationMatcherName
    string
    source
    string
    Valid values[ "\"BODY\"", "\"HEADER\"", "\"PATH\"", "\"QUERY\"", "\"URI_REGEX\"" ]
    path
    string
    400

    Table name is not unique

    Headers
    x-request-id
    string
    The ID of the request
    Expand All
    object

    Response object

    errors
    Array of object (Error)
    object
    code
    string
    id
    string
    status
    integer
    name
    string
    message
    string
    args
    object
    path
    string
    401

    Unauthorized

    Headers
    x-request-id
    string
    The ID of the request
    Expand All
    object

    Response object

    errors
    Array of object (Error)
    object
    code
    string
    id
    string
    status
    integer
    name
    string
    message
    string
    args
    object
    path
    string
    404

    Object not found

    Headers
    x-request-id
    string
    The ID of the request
    Expand All
    object

    Response object

    errors
    Array of object (Error)
    object
    code
    string
    id
    string
    status
    integer
    name
    string
    message
    string
    args
    object
    path
    string
    500

    Internal Server Error

    Headers
    x-request-id
    string
    The ID of the request
    Expand All
    object

    Response object

    errors
    Array of object (Error)
    object
    code
    string
    id
    string
    status
    integer
    name
    string
    message
    string
    args
    object
    path
    string

    Was this article helpful?