{"_id":"591f17b521d2ff0f00cf5a78","parentDoc":null,"project":"547cd7662eaee50800ed1089","category":{"_id":"591f17af21d2ff0f00cf5a48","__v":0,"project":"547cd7662eaee50800ed1089","version":"591f17ae21d2ff0f00cf5a3f","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-09-25T10:22:16.805Z","from_sync":false,"order":8,"slug":"public-api","title":"Public API"},"user":"547cd6ac78fd57080023ca99","__v":0,"version":{"_id":"591f17ae21d2ff0f00cf5a3f","__v":1,"project":"547cd7662eaee50800ed1089","createdAt":"2017-05-19T16:05:02.775Z","releaseDate":"2017-05-19T16:05:02.775Z","categories":["591f17af21d2ff0f00cf5a40","591f17af21d2ff0f00cf5a41","591f17af21d2ff0f00cf5a42","591f17af21d2ff0f00cf5a43","591f17af21d2ff0f00cf5a44","591f17af21d2ff0f00cf5a45","591f17af21d2ff0f00cf5a46","591f17af21d2ff0f00cf5a47","591f17af21d2ff0f00cf5a48"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.1","version":"1.0.1"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-09-28T14:13:05.096Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"language":"curl","code":"curl -H \"Authorization:Token b98f08d1c44cd5259dd70dc295e61187af45bffd23036f909919e608bdd8a592\" -i -X POST -d '{\"data\":{\"license_type_id\":26}}' \"https://public-api.devmate.com/v2/customers/45/licenses\"","name":""}]},"method":"post","results":{"codes":[{"name":"","code":"{\n  \"data\": {\n    \"license_type_name\": \"MyNewApp Single User License\",\n    \"license_type_id\": 26,\n    \"invoice\": \"\",\n    \"campaign\": \"\",\n    \"activations_used\": 0,\n    \"id\": 1185,\n    \"expiration_date\": null,\n    \"products\": [\n      {\n        \"id\": 1,\n        \"name\": \"MyNewApp\",\n        \"bundle_id\": \"com.acme.MyNewApp\",\n        \"use_offline_license\": false\n      }\n    ],\n    \"is_subscription\": false,\n    \"status\": 1,\n    \"activations_total\": 65535,\n    \"activation_key\": \"id593311373237odr\",\n    \"history\": [\n      {\n        \"type\": 2,\n        \"user_name\": \"\",\n        \"note\": \"\",\n        \"timestamp\": 1446563864\n      }\n    ]\n  }\n}","language":"json","status":201},{"code":"{\n    \"errors\": [\n        {\n            \"title\": \"Invalid field \\\"customer_id\\\".\",\n            \"detail\": \"Mandatory parameter \\\"customer_id\\\" is empty.\"\n        }\n    ]\n}","language":"json","status":400,"name":"Wrong customer ID"},{"name":"Wrong license ID","status":400,"language":"json","code":"{\n    \"errors\": [\n        {\n            \"title\": \"Invalid field \\\"license_type_id\\\".\",\n            \"detail\": \"Wrong \\\"license_type_id\\\" parameter given. License type #123 not found.\"\n        }\n    ]\n}"}]},"settings":"","auth":"required","params":[{"_id":"560a8c36f6994b0d0023bc3f","ref":"","in":"path","required":false,"desc":"Customer ID","default":"","type":"int","name":"customer_id"},{"_id":"56094af131beb60d001b65dd","ref":"","in":"body","required":false,"desc":"The ID of license type in DevMate (see below)","default":"","type":"int","name":"data[license_type_id]"}],"url":"/customers/:customer_id/licenses"},"isReference":false,"order":52,"body":"This method is used to create a license for the specific customer. The ID of customer needs to be passed in the URL of the request (`customer_id`). For example:\n\n````\nhttps://public-api.devmate.com/v2/customers/45/licenses\n````\nthis request will create a license for the customer with ID `45`.\n\nLicense ID can be found in DevMate Dashboard under *App Settings > License Types*.\n\nDescription of response fields see [here](doc:get-customers). \n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/cbRHrslhT8CjhBKb1kMn_License_type_id.png\",\n        \"License_type_id.png\",\n        \"1000\",\n        \"579\",\n        \"#fc1c15\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nIn case of success, you will receive an activation number within the server response, so you may provide it to your customer.\n\nExample shows the creation of license with ID 26.\n\n#Response Codes\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"`201`\",\n    \"0-1\": \"License was successfully created\",\n    \"1-0\": \"`400`\",\n    \"1-1\": \"Bad request. Customer id was not specified or incorrect or wrong license id provided\",\n    \"2-0\": \"`401`\",\n    \"2-1\": \"Authorization failed\",\n    \"3-0\": \"`500`\",\n    \"3-1\": \"Server error\"\n  },\n  \"cols\": 2,\n  \"rows\": 4\n}\n[/block]","excerpt":"","slug":"create-license-for-customer","type":"post","title":"Create License for Customer"}

postCreate License for Customer


Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

customer_id:
integer
Customer ID

Body Params

data[license_type_id]:
integer
The ID of license type in DevMate (see below)

Examples


Result Format


Documentation

This method is used to create a license for the specific customer. The ID of customer needs to be passed in the URL of the request (`customer_id`). For example: ```` https://public-api.devmate.com/v2/customers/45/licenses ```` this request will create a license for the customer with ID `45`. License ID can be found in DevMate Dashboard under *App Settings > License Types*. Description of response fields see [here](doc:get-customers). [block:image] { "images": [ { "image": [ "https://files.readme.io/cbRHrslhT8CjhBKb1kMn_License_type_id.png", "License_type_id.png", "1000", "579", "#fc1c15", "" ] } ] } [/block] In case of success, you will receive an activation number within the server response, so you may provide it to your customer. Example shows the creation of license with ID 26. #Response Codes [block:parameters] { "data": { "0-0": "`201`", "0-1": "License was successfully created", "1-0": "`400`", "1-1": "Bad request. Customer id was not specified or incorrect or wrong license id provided", "2-0": "`401`", "2-1": "Authorization failed", "3-0": "`500`", "3-1": "Server error" }, "cols": 2, "rows": 4 } [/block]

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}