Skip to content

authentic.network API documentation v2.4.0

Documentation for the REST api access of authentic.api


Webhook

Content created

Back to top

Each time content is created and an webhook is configured for "contentCreated", the end point of a the webhook is called with the following request. If the endpoint responds with a status code less than 400, the call is considered successful. If not, the end point is called again later with the same request data.

POST /contentCreated

Parameters examples

json - Request-Example:

{
  "headers": {
    "host": "wh-echo.dev.authentic.network",
    "user-agent": "Go-http-client/1.1",
    "content-length": "711",
    "accept": "application/json",
    "content-type": "application/json",
    "accept-encoding": "gzip"
  },
  "params": {},
  "payload": {
    "event": {
      "type": "contentCreated"
    },
    "content": {
      "id": "I4X4eTi5uESmEylcnk6S",
      "data": {
        "_created": 1594845232371,
        "_updated": 1594845232371,
        "path": "/contents/5eed51e1-4640-4777-ae45-7985d43ede65",
        "url": "https://firebasestorage.googleapis.com/v0/b/an-scan-test.appspot.com/o/contents%2F5eed51e1-4640-4777-ae45-7985d43ede65?alt=media&token=45eccbee-70a6-4ad9-b3dd-f557432c5460",
        "size": 17,
        "_owner": "authentic-test",
        "content-type": "plain/text"
      }
    },
    "producer": {
      "id": "authentic-test",
      "data": {
        "name": "authentic"
      }
    },
    "hook": {
      "id": "test-hook",
      "data": {
        "type": "httprequest",
        "url": "http://localhost:3001/callback",
        "_created": 1594845229322,
        "_updated": 1594845229322,
        "events": "*",
        "executed": 0,
        "data": {
          "token": "default-web-hook"
        }
      }
    }
  }
}

Content deleted

Back to top

Each time content is deleted and an webhook is configured for "contentDeleted", the end point of a the webhook is called with the following request. If the endpoint responds with a status code less than 400, the call is considered successful. If not, the end point is called again later with the same request data.

POST /contentDeleted

Parameters examples

json - Request-Example:

{
  "headers": {
    "host": "wh-echo.dev.authentic.network",
    "user-agent": "Go-http-client/1.1",
    "content-length": "711",
    "accept": "application/json",
    "content-type": "application/json",
    "accept-encoding": "gzip"
  },
  "params": {},
  "payload": {
    "event": {
      "type": "contentDeleted"
    },
    "content": {
      "id": "I4X4eTi5uESmEylcnk6S",
      "data": {
        "_created": 1594845232371,
        "_updated": 1594845232371,
        "path": "/contents/5eed51e1-4640-4777-ae45-7985d43ede65",
        "url": "https://firebasestorage.googleapis.com/v0/b/an-scan-test.appspot.com/o/contents%2F5eed51e1-4640-4777-ae45-7985d43ede65?alt=media&token=45eccbee-70a6-4ad9-b3dd-f557432c5460",
        "size": 17,
        "_owner": "authentic-test",
        "content-type": "plain/text"
      }
    },
    "producer": {
      "id": "authentic-test",
      "data": {
        "name": "authentic"
      }
    },
    "hook": {
      "id": "test-hook",
      "data": {
        "type": "httprequest",
        "url": "http://localhost:3001/callback",
        "_created": 1594845229322,
        "_updated": 1594845229322,
        "events": "*",
        "executed": 0,
        "data": {
          "token": "default-web-hook"
        }
      }
    }
  }
}

Group created

Back to top

Each time an group is created and an webhook is configured for "groupCreated", the end point of a the webhook is called with the following request. If the endpoint responds with a status code less than 400, the call is considered successful. If not, the end point is called again later with the same request data.

POST /groupCreated

Parameters examples

json - Request-Example:

{
  "headers": {
    "host": "wh-echo.dev.authentic.network",
    "user-agent": "Go-http-client/1.1",
    "content-length": "711",
    "accept": "application/json",
    "content-type": "application/json",
    "accept-encoding": "gzip"
  },
  "params": {},
  "payload": {
    "event": {
      "type": "groupCreated"
    },
    "group": {
      "id": "pR72YvUGaaUpmixkPOgC",
      "data": {
        "_created": 1594834188064,
        "_updated": 1594834188064,
        "_owner": "authentic-test",
        "data": {}
      }
    },
    "producer": {
      "id": "authentic-test",
      "data": {
        "name": "authentic"
      }
    },
    "hook": {
      "id": "test-hook",
      "data": {
        "data": {
          "token": "default-web-hook"
        },
        "events": "*",
        "type": "httprequest",
        "_created": 1594834187377,
        "url": "http://localhost:3001/callback",
        "executed": 0,
        "_updated": 1594834187377
      }
    }
  }
}

Group deleted

Back to top

Each time an group is deleted and an webhook is configured for "groupDeleted", the end point of a the webhook is called with the following request. If the endpoint responds with a status code less than 400, the call is considered successful. If not, the end point is called again later with the same request data.

POST /groupDeleted

Parameters examples

json - Request-Example:

{
  "headers": {
    "host": "wh-echo.dev.authentic.network",
    "user-agent": "Go-http-client/1.1",
    "content-length": "711",
    "accept": "application/json",
    "content-type": "application/json",
    "accept-encoding": "gzip"
  },
  "params": {},
  "payload": {
    "event": {
      "type": "groupDeleted"
    },
    "group": {
      "id": "l8QwdqzcEswf7iCmjPzc",
      "data": {
        "_created": 1594838786580,
        "data": {
          "key": "dddea55e37a9ce745cee15585b0f1e1d983bab3d"
        },
        "_updated": 1594838789537,
        "_owner": "authentic-test"
      }
    },
    "producer": {
      "id": "authentic-test",
      "data": {
        "name": "authentic"
      }
    },
    "hook": {
      "id": "test-hook",
      "data": {
        "executed": 0,
        "events": "*",
        "type": "httprequest",
        "_created": 1594838784819,
        "data": {
          "token": "default-web-hook"
        },
        "url": "http://localhost:3001/callback",
        "_updated": 1594838784819
      }
    }
  }
}

Group modified

Back to top

Each time an group is modified and an webhook is configured for "groupModified", the end point of a the webhook is called with the following request. If the endpoint responds with a status code less than 400, the call is considered successful. If not, the end point is called again later with the same request data.

POST /groupModified

Parameters examples

json - Request-Example:

{
  "headers": {
    "host": "wh-echo.dev.authentic.network",
    "user-agent": "Go-http-client/1.1",
    "content-length": "711",
    "accept": "application/json",
    "content-type": "application/json",
    "accept-encoding": "gzip"
  },
  "params": {},
  "payload": {
    "event": {
      "type": "groupModified"
    },
    "group": {
      "id": "l8QwdqzcEswf7iCmjPzc",
      "data": {
        "_created": 1594838786580,
        "data": {
          "key": "dddea55e37a9ce745cee15585b0f1e1d983bab3d"
        },
        "_updated": 1594838789537,
        "_owner": "authentic-test"
      }
    },
    "producer": {
      "id": "authentic-test",
      "data": {
        "name": "authentic"
      }
    },
    "hook": {
      "id": "test-hook",
      "data": {
        "executed": 0,
        "events": "*",
        "type": "httprequest",
        "_created": 1594838784819,
        "data": {
          "token": "default-web-hook"
        },
        "url": "http://localhost:3001/callback",
        "_updated": 1594838784819
      }
    }
  }
}

Item added to group

Back to top

Important: Webhook not implemented yet! Each time an item is added to a group and an webhook is configured for "itemAddedToGroup", the end point of a the webhook is called with the following request. If the endpoint responds with a status code less than 400, the call is considered successful. If not, the end point is called again later with the same request data.

POST /itemAddedToGroup

Parameters examples

json - Request-Example:

{
  "headers": {
    "host": "wh-echo.dev.authentic.network",
    "user-agent": "Go-http-client/1.1",
    "content-length": "711",
    "accept": "application/json",
    "content-type": "application/json",
    "accept-encoding": "gzip"
  },
  "params": {},
  "payload": {
    "event": {
      "type": "itemAddedToGroup"
    },
    "identifier": {
      "id": "456e30ce1251229f6537424cb989c4025e1f8e76",
      "data": {
        "_producer": "authentic-test",
        "_updated": 1594896186437,
        "_created": 1594896184692,
        "_group": "WPswbisMw5v2dylw59tG"
      }
    },
    "group": {
      "id": "WPswbisMw5v2dylw59tG",
      "data": {
        "_updated": 1594896182746,
        "_created": 1594896182746,
        "data": {},
        "_owner": "authentic-test"
      }
    },
    "producer": {
      "id": "authentic-test",
      "data": {
        "name": "authentic"
      }
    },
    "hook": {
      "id": "test-hook",
      "data": {
        "type": "httprequest",
        "url": "http://localhost:3001/callback",
        "_created": 1594845229322,
        "_updated": 1594845229322,
        "events": "*",
        "executed": 0,
        "data": {
          "token": "default-web-hook"
        }
      }
    }
  }
}

Item created

Back to top

Each time an item is created and an webhook is configured for "itemCreated", the end point of a the webhook is called with the following request. If the endpoint responds with a status code less than 400, the call is considered successful. If not, the end point is called again later with the same request data.

POST /itemCreated

Parameters examples

json - Request-Example:

{
  "headers": {
    "host": "wh-echo.dev.authentic.network",
    "user-agent": "Go-http-client/1.1",
    "content-length": "711",
    "accept": "application/json",
    "content-type": "application/json",
    "accept-encoding": "gzip"
  },
  "params": {},
  "payload": {
    "event": {
      "type": "itemCreated"
    },
    "identifier": {
      "id": "df9354f44b314e9ece8d4440aa5ab9b4fce28bb2",
      "data": {
        "title": "Test Item",
        "_created": 1594841331277,
        "_updated": 1594841333396,
        "_producer": "authentic-test",
        "data": {
          "key": "52e829f7f9075a45e527b8c7f87ae1e256ab20f9"
        }
      }
    },
    "group": {},
    "producer": {
      "id": "authentic-test",
      "data": {
        "name": "authentic"
      }
    },
    "hook": {
      "id": "test-hook",
      "data": {
        "executed": 0,
        "type": "httprequest",
        "data": {
          "token": "default-web-hook"
        },
        "events": "*",
        "_updated": 1594841329245,
        "url": "http://localhost:3001/callback",
        "_created": 1594841329245
      }
    }
  }
}

Item delete from group

Back to top

Important: Webhook not implemented yet! Each time an item is removed to a group and an webhook is configured for "itemDeletedFromGroup", the end point of a the webhook is called with the following request. If the endpoint responds with a status code less than 400, the call is considered successful. If not, the end point is called again later with the same request data.

POST /itemDeletedFromGroup

Parameters examples

json - Request-Example:

{
  "headers": {
    "host": "wh-echo.dev.authentic.network",
    "user-agent": "Go-http-client/1.1",
    "content-length": "711",
    "accept": "application/json",
    "content-type": "application/json",
    "accept-encoding": "gzip"
  },
  "params": {},
  "payload": {
    "event": {
      "type": "itemDeletedFromGroup"
    },
    "identifier": {
      "id": "456e30ce1251229f6537424cb989c4025e1f8e76",
      "data": {
        "_producer": "authentic-test",
        "_updated": 1594896186437,
        "_created": 1594896184692,
        "_group": "WPswbisMw5v2dylw59tG"
      }
    },
    "group": {
      "id": "WPswbisMw5v2dylw59tG",
      "data": {
        "_updated": 1594896182746,
        "_created": 1594896182746,
        "data": {},
        "_owner": "authentic-test"
      }
    },
    "producer": {
      "id": "authentic-test",
      "data": {
        "name": "authentic"
      }
    },
    "hook": {
      "id": "test-hook",
      "data": {
        "type": "httprequest",
        "url": "http://localhost:3001/callback",
        "_created": 1594845229322,
        "_updated": 1594845229322,
        "events": "*",
        "executed": 0,
        "data": {
          "token": "default-web-hook"
        }
      }
    }
  }
}

Item deleted

Back to top

Each time an item is deleted and an webhook is configured for "itemDeleted", the end point of a the webhook is called with the following request. If the endpoint responds with a status code less than 400, the call is considered successful. If not, the end point is called again later with the same request data.

POST /itemDeleted

Parameters examples

json - Request-Example:

{
  "headers": {
    "host": "wh-echo.dev.authentic.network",
    "user-agent": "Go-http-client/1.1",
    "content-length": "711",
    "accept": "application/json",
    "content-type": "application/json",
    "accept-encoding": "gzip"
  },
  "params": {},
  "payload": {
    "event": {
      "type": "itemDeleted"
    },
    "identifier": {
      "id": "df9354f44b314e9ece8d4440aa5ab9b4fce28bb2",
      "data": {
        "title": "Test Item",
        "_created": 1594841331277,
        "_updated": 1594841333396,
        "_producer": "authentic-test",
        "data": {
          "key": "52e829f7f9075a45e527b8c7f87ae1e256ab20f9"
        }
      }
    },
    "group": {},
    "producer": {
      "id": "authentic-test",
      "data": {
        "name": "authentic"
      }
    },
    "hook": {
      "id": "test-hook",
      "data": {
        "executed": 0,
        "type": "httprequest",
        "data": {
          "token": "default-web-hook"
        },
        "events": "*",
        "_updated": 1594841329245,
        "url": "http://localhost:3001/callback",
        "_created": 1594841329245
      }
    }
  }
}

Item invalidated

Back to top

Each time an item is invalidated and an webhook is configured for "itemInvalidated", the end point of a the webhook is called with the following request. If the endpoint responds with a status code less than 400, the call is considered successful. If not, the end point is called again later with the same request data.

POST /itemInvalidated

Parameters examples

json - Request-Example:

{
  "headers": {
    "host": "wh-echo.dev.authentic.network",
    "user-agent": "Go-http-client/1.1",
    "content-length": "711",
    "accept": "application/json",
    "content-type": "application/json",
    "accept-encoding": "gzip"
  },
  "params": {},
  "payload": {
    "event": {
      "type": "itemInvalidated"
    },
    "identifier": {
      "id": "df9354f44b314e9ece8d4440aa5ab9b4fce28bb2",
      "data": {
        "title": "Test Item",
        "_created": 1594841331277,
        "_updated": 1594841333396,
        "_producer": "authentic-test",
        "invalidated": true,  
        "data": {
          "key": "52e829f7f9075a45e527b8c7f87ae1e256ab20f9"
        }
      }
    },
    "group": {},
    "producer": {
      "id": "authentic-test",
      "data": {
        "name": "authentic"
      }
    },
    "hook": {
      "id": "test-hook",
      "data": {
        "executed": 0,
        "type": "httprequest",
        "data": {
          "token": "default-web-hook"
        },
        "events": "*",
        "_updated": 1594841329245,
        "url": "http://localhost:3001/callback",
        "_created": 1594841329245
      }
    }
  }
}

Item modified

Back to top

Each time an item is modified and an webhook is configured for "itemModified", the end point of a the webhook is called with the following request. If the endpoint responds with a status code less than 400, the call is considered successful. If not, the end point is called again later with the same request data.

POST /itemModified

Parameters examples

json - Request-Example:

{
  "headers": {
    "host": "wh-echo.dev.authentic.network",
    "user-agent": "Go-http-client/1.1",
    "content-length": "711",
    "accept": "application/json",
    "content-type": "application/json",
    "accept-encoding": "gzip"
  },
  "params": {},
  "payload": {
    "event": {
      "type": "itemModified"
    },
    "identifier": {
      "id": "df9354f44b314e9ece8d4440aa5ab9b4fce28bb2",
      "data": {
        "title": "Test Item",
        "_created": 1594841331277,
        "_updated": 1594841333396,
        "_producer": "authentic-test",
        "data": {
          "key": "52e829f7f9075a45e527b8c7f87ae1e256ab20f9"
        }
      }
    },
    "group": {},
    "producer": {
      "id": "authentic-test",
      "data": {
        "name": "authentic"
      }
    },
    "hook": {
      "id": "test-hook",
      "data": {
        "executed": 0,
        "type": "httprequest",
        "data": {
          "token": "default-web-hook"
        },
        "events": "*",
        "_updated": 1594841329245,
        "url": "http://localhost:3001/callback",
        "_created": 1594841329245
      }
    }
  }
}

Item scanned

Back to top

Each time an item is scanned and an webhook is configured for "itemScanned", the end point of a the webhook is called with the following request. If the endpoint responds with a status code less than 400, the call is considered successful. If not, the end point is called again later with the same request data.

POST /itemScanned

Parameters examples

json - Request-Example:

{
  "headers": {
    "host": "wh-echo.dev.authentic.network",
    "user-agent": "Go-http-client/1.1",
    "content-length": "711",
    "accept": "application/json",
    "content-type": "application/json",
    "accept-encoding": "gzip"
  },
  "params": {},
  "payload": {
    "event": {
      "type": "itemScanned"
    },
    "scan": {
      "id": "WNrIeoG9tojWe7PIzVuD",
      "data": {
        "identifier": "0001",
        "creator": "unknown",
        "timestamp": 1592988670307,
        "copyclassification": "original",
        "location": {
          "_lat": 51.123,
          "_long": 13.123
        },
        "data": {
          "key": "value"
        },
        "os": "ios",
        "device": "pn-message-token",
        "softwareversion": "sa-1.0.10",
        "country": "DE",
        "continent": "Europe"
      }
    },
    "item": {
      "id": "0001",
      "data": {
        "image": "/images/identifiers/0001/drug.png",
        "title": "Paracetamol 600mg",
        "_producer": "authentic-test",
        "_updated": 1592988670957,
        "_fakes": 1496,
        "_created": 1586439433831,
        "verificationinfos": [
          {
            "visibility": "verified",
            "value": "HelpPharma",
            "label": "Manufactor"
          }
        ],
        "_scans": 2010
      }
    },
    "hook": {
      "id": "4uUl2kKLpxBMuDfHq2ZE",
      "data": {
        "events": "itemScanned",
        "type": "httprequest",
        "url": "https://wh-echo.dev.authentic.network/webhook-endpoint",
        "data": {
          "key": "value"
        }
      }
    }
  }
}