Skip to content

Modify Card

Request URL

POST /cards/:AFiCardId

Description

This endpoint modifies the properties of a card. The card is identified by the path parameter.

Only the properties to be changed should be included in the payload. Changes will only be made to properties that are permitted to change.

Schema

Property table for cards/:AFiCardId

Property Description Required Schema
AFiCardId ampliFi ID for the card Yes {
  "type": "string"
}
name Name of the entity No {
  "type": "string",
  "nullable": true
}
isMain true if this is the main account or card No {
  "type": "boolean",
  "nullable": true
}

Request Body

{
    "name": "TestCard4",
    "isMain": "true"
}

Snippet Examples

javascript

const axios = require('axios');
const data = {
    "name": "TestCard4",
    "isMain": "true"
};
const config = {
  method: 'POST',
  url: '${AMPLIFI_BASE_URL}/cards/:AFiCardId',
  headers: {
    'Content-Type': "application/json",
    'token': "A long random string token received from /token request"
  },
  data
};

let result;
try {
  result = await axios.request(config);
  if (result.status === 200) {
    console.log(JSON.stringify(result.data));
  }
} catch (err) {
  console.log({
    errCode: err.code,
    responseStatus: err.response && err.response.status,
    data: err.response && JSON.stringify(err.response.data)
  });
}

cURL

curl --location "AMPLIFI_BASE_URL/cards/:AFiCardId" --data "{    \"name\":\"TestCard4\",   \"isMain\":\"true\"}" --header "Content-Type: application/json" --header "token: A long random string token received from /token request" 

Successful Response Examples

200 CARDS/:AFICARDID SUCCESSFUL RESPONSE MODIFYING SPECIFIED CARD

HEADERS

Header Value
Content-Type application/json
token A long random string token received from /token request

PARAMETERS

Parameter Description Value
AFiCardId [required] qwecdlgmgtddkabyzkuaibfraesqglomhadsmctvbzi

REQUEST BODY

{
    "name": "TestCard4",
    "isMain": "true"
}

RESPONSE BODY

{
    "success": true
}