Create a goal
Create a goal
Query Parameters
Possible values: [1
, 2
, 3
, 4
, 5
, 6
, 7
, 11
, 19
]
The id of the Mushaf being used.
1 = QCFV2
2 = QCFV1
3 = Indopak
4 = UthmaniHafs
5 = KFGQPCHAFS
6 = Indopak15Lines
7 = Indopak16Lines
11 = Tajweeed
19 = QCFTajweedV4
Header Parameters
The current timezone of the user. Not providing the value might affect the accuracy of how we calculate days and streaks.
Request Body
Possible values: [QURAN_TIME
, QURAN_PAGES
, QURAN_RANGE
, COURSE
, QURAN_READING_PROGRAM
]
The type of the goal.
amount object required
Possible values: >= 1
The duration of the goal in days. If it's empty it means the goal is a daily goal and not duration-based.
Possible values: [QURAN
, COURSE
, QURAN_READING_PROGRAM
]
The category of the goal
- 200
- 400
- 401
- 403
- 404
- 422
- 429
- 500
- 502
- 503
- 504
Request has been handled successfully.
Schema
data object
{
"success": true,
"data": {
"id": "cm8qg6tn0000dagpseny4h932"
}
}
The request is missing required parameters or is invalid.
Schema
{
"message": "The request is missing required headers or is invalid",
"type": "invalid_request",
"success": false
}
The request is unauthorized.
Schema
{
"message": "The request requires user authentication",
"type": "unauthorized",
"success": false
}
Forbidden error. Can either be due to access token not being passed, having been expired or the caller trying to access a resource without enough permissions.
Schema
{
"message": "The server understood the request, but refuses to authorize it",
"type": "forbidden",
"success": false
}
Not Found. The resource being accessed does not exist.
Schema
{
"message": "The requested resource could not be found",
"type": "not_found",
"success": false
}
Validation Error. The request includes one or more invalid params. Please check the request params and try again.
Schema
{
"message": "The request was well-formed but was unable to be followed due to semantic errors",
"type": "unprocessable_entity",
"success": false
}
Too many requests, please try again later.
Schema
{
"message": "Too many requests, please try again later",
"type": "rate_limit_exceeded",
"success": false
}
Server Error. Something went wrong, try again later.
Schema
{
"message": "The server encountered an internal error and was unable to complete your request",
"type": "internal_server_error",
"success": false
}
Invalid response from the upstream server
Schema
{
"message": "The server was acting as a gateway or proxy and received an invalid response from the upstream server",
"type": "bad_gateway",
"success": false
}
The server is currently unable to handle the request due to a temporary overload or scheduled maintenance
Schema
{
"message": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance",
"type": "service_unavailable",
"success": false
}
The server did not receive a timely response from the upstream server.
Schema
{
"message": "The server was acting as a gateway or proxy and did not receive a timely response from the upstream server",
"type": "gateway_timeout",
"success": false
}
POST /v1/goals/
Authorization
name: x-auth-tokentype: apiKeyin: headerdescription: The JWT access token required for accessing the endpoints.
name: x-client-idtype: apiKeyin: headerdescription: Your client id
Request
Request
curl -L -X POST 'https://apis-prelive.quran.foundation/auth/v1/goals/' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-auth-token: <API_KEY_VALUE>' \
-H 'x-client-id: <API_KEY_VALUE>' \
--data-raw '{
"type": "QURAN_TIME",
"amount": "1:5-1:10",
"duration": 0,
"category": "QURAN"
}'
curl -L -X POST 'https://apis-prelive.quran.foundation/auth/v1/goals/' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-auth-token: <API_KEY_VALUE>' \
-H 'x-client-id: <API_KEY_VALUE>' \
--data-raw '{
"type": "QURAN_TIME",
"amount": "1:5-1:10",
"duration": 0,
"category": "QURAN"
}'
curl -L -X POST 'https://apis-prelive.quran.foundation/auth/v1/goals/' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-auth-token: <API_KEY_VALUE>' \
-H 'x-client-id: <API_KEY_VALUE>' \
--data-raw '{
"type": "QURAN_TIME",
"amount": "1:5-1:10",
"duration": 0,
"category": "QURAN"
}'
curl -L -X POST 'https://apis-prelive.quran.foundation/auth/v1/goals/' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-auth-token: <API_KEY_VALUE>' \
-H 'x-client-id: <API_KEY_VALUE>' \
--data-raw '{
"type": "QURAN_TIME",
"amount": "1:5-1:10",
"duration": 0,
"category": "QURAN"
}'
curl -L -X POST 'https://apis-prelive.quran.foundation/auth/v1/goals/' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-auth-token: <API_KEY_VALUE>' \
-H 'x-client-id: <API_KEY_VALUE>' \
--data-raw '{
"type": "QURAN_TIME",
"amount": "1:5-1:10",
"duration": 0,
"category": "QURAN"
}'
curl -L -X POST 'https://apis-prelive.quran.foundation/auth/v1/goals/' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-auth-token: <API_KEY_VALUE>' \
-H 'x-client-id: <API_KEY_VALUE>' \
--data-raw '{
"type": "QURAN_TIME",
"amount": "1:5-1:10",
"duration": 0,
"category": "QURAN"
}'
curl -L -X POST 'https://apis-prelive.quran.foundation/auth/v1/goals/' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-auth-token: <API_KEY_VALUE>' \
-H 'x-client-id: <API_KEY_VALUE>' \
--data-raw '{
"type": "QURAN_TIME",
"amount": "1:5-1:10",
"duration": 0,
"category": "QURAN"
}'
curl -L -X POST 'https://apis-prelive.quran.foundation/auth/v1/goals/' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-auth-token: <API_KEY_VALUE>' \
-H 'x-client-id: <API_KEY_VALUE>' \
--data-raw '{
"type": "QURAN_TIME",
"amount": "1:5-1:10",
"duration": 0,
"category": "QURAN"
}'
curl -L -X POST 'https://apis-prelive.quran.foundation/auth/v1/goals/' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-auth-token: <API_KEY_VALUE>' \
-H 'x-client-id: <API_KEY_VALUE>' \
--data-raw '{
"type": "QURAN_TIME",
"amount": "1:5-1:10",
"duration": 0,
"category": "QURAN"
}'